├── samples ├── petclinic │ ├── db │ │ ├── hsqldb │ │ │ ├── petclinic.data │ │ │ ├── server.properties │ │ │ ├── manager.bat │ │ │ ├── manager.sh │ │ │ ├── server.bat │ │ │ ├── server.sh │ │ │ ├── dropDB.txt │ │ │ └── petclinic.properties │ │ └── mysql │ │ │ └── dropDB.txt │ ├── as │ │ └── jboss │ │ │ ├── 3.2.x │ │ │ ├── install.txt │ │ │ └── mysql-petclinic-ds.xml │ │ │ └── jboss-web.xml │ ├── lib │ │ ├── hsqldb.jar │ │ └── mysql-connector-java-2.0.14-bin.jar │ ├── src │ │ └── petclinic │ │ │ ├── package.html │ │ │ ├── web │ │ │ └── package.html │ │ │ ├── jdbc │ │ │ ├── package.html │ │ │ ├── HsqlClinic.java │ │ │ └── MysqlClinic.java │ │ │ ├── validation │ │ │ ├── package.html │ │ │ ├── FindOwnersValidator.java │ │ │ ├── VisitValidator.java │ │ │ └── PetValidator.java │ │ │ ├── NoSuchEntityException.java │ │ │ ├── Entity.java │ │ │ ├── NamedEntity.java │ │ │ └── Vet.java │ ├── lib-new │ │ └── mysql-connector-java-3.0.8-stable-bin.jar │ ├── war │ │ ├── index.jsp │ │ └── WEB-INF │ │ │ ├── jsp │ │ │ ├── includes.jsp │ │ │ ├── fields │ │ │ │ ├── city.jsp │ │ │ │ ├── address.jsp │ │ │ │ ├── firstName.jsp │ │ │ │ ├── lastName.jsp │ │ │ │ └── telephone.jsp │ │ │ ├── welcome.jsp │ │ │ ├── findOwners.jsp │ │ │ ├── vets.jsp │ │ │ ├── ownerForm.jsp │ │ │ └── owners.jsp │ │ │ └── classes │ │ │ ├── messages.properties │ │ │ ├── messages_en.properties │ │ │ ├── messages_de.properties │ │ │ └── log4j.properties │ ├── ant.bat │ └── test │ │ └── src │ │ └── petclinic │ │ └── OwnerTest.java ├── countries │ ├── warfile.bat │ ├── lib │ │ └── content.txt │ ├── war │ │ ├── WEB-INF │ │ │ ├── views │ │ │ │ └── jsp │ │ │ │ │ ├── countries │ │ │ │ │ ├── main │ │ │ │ │ │ ├── detailnav.jsp │ │ │ │ │ │ ├── detail.jsp │ │ │ │ │ │ └── nav.jsp │ │ │ │ │ ├── top.jsp │ │ │ │ │ ├── config_de.jsp │ │ │ │ │ ├── config_fr.jsp │ │ │ │ │ ├── copy.jsp │ │ │ │ │ ├── home.jsp │ │ │ │ │ └── model.jsp │ │ │ │ │ ├── common │ │ │ │ │ └── includes.jsp │ │ │ │ │ └── errors │ │ │ │ │ └── http404.jsp │ │ │ └── classes │ │ │ │ ├── none.properties │ │ │ │ ├── blue_de.properties │ │ │ │ ├── blue_en.properties │ │ │ │ ├── blue_fr.properties │ │ │ │ ├── theme_de.properties │ │ │ │ ├── theme_en.properties │ │ │ │ ├── theme_fr.properties │ │ │ │ ├── messages_en.properties │ │ │ │ ├── blue.properties │ │ │ │ ├── theme.properties │ │ │ │ ├── messages_de.properties │ │ │ │ ├── messages_fr.properties │ │ │ │ ├── views-countries_de.properties │ │ │ │ ├── views-countries_en.properties │ │ │ │ ├── views-countries_fr.properties │ │ │ │ └── log4j.properties │ │ ├── images │ │ │ ├── de.gif │ │ │ ├── fr.gif │ │ │ ├── us.gif │ │ │ └── back.gif │ │ ├── themes │ │ │ ├── blue │ │ │ │ ├── logo.gif │ │ │ │ ├── bback_de.gif │ │ │ │ ├── bback_en.gif │ │ │ │ └── bback_fr.gif │ │ │ └── white │ │ │ │ ├── logo.gif │ │ │ │ ├── wback_de.gif │ │ │ │ ├── wback_en.gif │ │ │ │ └── wback_fr.gif │ │ └── index.jsp │ ├── as │ │ └── jboss │ │ │ ├── install.txt │ │ │ ├── 3.0.x │ │ │ └── install.txt │ │ │ ├── 3.2.x │ │ │ ├── install.txt │ │ │ └── mysql-countries-ds.xml │ │ │ └── jboss-web.xml │ ├── db │ │ ├── hsqldb.jar │ │ └── mysql-connector-java-3.0.8-stable-bin.jar │ ├── ant.bat │ └── src │ │ └── com │ │ └── interface21 │ │ └── samples │ │ └── countries │ │ ├── appli │ │ ├── ICountry.java │ │ └── Country.java │ │ ├── dao │ │ └── DaoCountryJdbcMySql.java │ │ └── web │ │ └── ErrorsController.java └── skeletons │ ├── webapp-typical │ └── WEB-INF │ │ └── classes │ │ ├── messages_de.properties │ │ ├── example-messages_de.properties │ │ ├── messages.properties │ │ ├── example-messages.properties │ │ ├── views_de.properties │ │ ├── views.properties │ │ └── log4j.properties │ ├── readme.txt │ └── webapp-hibernate │ └── WEB-INF │ └── classes │ └── example.hbm.xml ├── test ├── com │ └── interface21 │ │ ├── orm │ │ └── jdo │ │ │ └── test.properties │ │ ├── web │ │ ├── context │ │ │ └── WEB-INF │ │ │ │ ├── theme_en_GB.properties │ │ │ │ ├── test-messages.properties │ │ │ │ ├── test-theme.properties │ │ │ │ ├── myinit.properties │ │ │ │ ├── theme_en_US.properties │ │ │ │ ├── theme.properties │ │ │ │ ├── context-messages_en_GB.properties │ │ │ │ ├── contextInclude.xml │ │ │ │ ├── context-messages.properties │ │ │ │ ├── context-messages_en_US.properties │ │ │ │ └── testNamespace.xml │ │ └── servlet │ │ │ ├── view │ │ │ ├── BaseViewTests.java │ │ │ ├── ResourceBundleViewResolverTestSuiteNoCache.java │ │ │ ├── testviews_fr.properties │ │ │ ├── views.xml │ │ │ └── testviews.properties │ │ │ ├── complexviews.properties │ │ │ └── handler │ │ │ └── map1.xml │ │ ├── beans │ │ ├── IOther.java │ │ ├── Employee.java │ │ ├── factory │ │ │ ├── xml │ │ │ │ ├── factoryCircle.xml │ │ │ │ ├── invalid.xml │ │ │ │ ├── parent.xml │ │ │ │ ├── DummyReferencer.java │ │ │ │ ├── MixedCollectionBean.java │ │ │ │ └── initializers.xml │ │ │ ├── support │ │ │ │ ├── leaf.xml │ │ │ │ ├── root.xml │ │ │ │ └── middle.xml │ │ │ ├── KnowsIfInstantiated.java │ │ │ └── MustBeInitialized.java │ │ ├── ITestBean.java │ │ └── BooleanTestBean.java │ │ ├── aop │ │ ├── framework │ │ │ ├── Lockable.java │ │ │ ├── LockedException.java │ │ │ └── TimestampIntroductionInterceptor.java │ │ └── attributes │ │ │ └── wildcardAtts.xml │ │ ├── context │ │ ├── BeanThatListens.java │ │ ├── ACATest.java │ │ └── TestListener.java │ │ ├── jdbc │ │ └── mock │ │ │ ├── SpringMockStatement.java │ │ │ ├── SpringMockPreparedStatement.java │ │ │ └── SpringMockDataSource.java │ │ └── jndi │ │ └── JndiObjectFactoryBeanTests.java └── log4j.properties ├── lib ├── ant │ └── ant.jar ├── j2ee │ ├── ejb.jar │ ├── jms.jar │ ├── jta.jar │ ├── servlet.jar │ ├── xml-apis.jar │ └── jdbc2_0-stdext.jar ├── jdo │ └── jdo1_0.jar ├── jstl │ ├── jstl.jar │ └── standard.jar ├── clover │ └── clover.jar ├── junit │ └── junit.jar ├── cglib │ ├── bcel-5.1.jar │ └── cglib-1.0.jar ├── hibernate │ ├── dom4j.jar │ ├── hibernate2.jar │ ├── commons-lang.jar │ └── commons-collections.jar ├── itext-pdf │ └── iText.jar ├── easymock │ └── easymock.jar ├── log4j │ ├── log4j-1.2.8.jar │ └── commons-logging.jar ├── caucho │ ├── burlap-2.1.7.jar │ └── hessian-2.1.7.jar ├── velocity │ └── velocity-1.3.jar ├── aop-alliance │ └── aopalliance.jar ├── poi │ └── poi-2.0-pre3-20030728.jar ├── regexp │ └── jakarta-oro-2.0.7.jar └── mockobjects │ ├── mockobjects-0.07-core.jar │ ├── mockobjects-0.07-jdk1.3.jar │ └── mockobjects-0.07-j1.3-j2ee1.3.jar ├── docs ├── tutorial.pdf └── MVC-step-by-step │ ├── Spring-MVC-Step22.png │ ├── Spring-MVC-step-by-step_html_m3871950e.png │ ├── Spring-MVC-step-by-step_html_m5b7553b2.png │ ├── Spring-MVC-step-by-step-Part-2_html_1969edd8.png │ └── Spring-MVC-step-by-step-Part-2_html_m3eb7013.png ├── xdocs ├── images │ └── logo-blue.png ├── goals.xml ├── status.xml ├── features.xml ├── index.xml └── navigation.xml ├── src └── com │ └── interface21 │ ├── jdbc │ ├── util │ │ └── package.html │ ├── datasource │ │ ├── package.html │ │ ├── CannotGetJdbcConnectionException.java │ │ └── ConnectionHolder.java │ ├── core │ │ ├── support │ │ │ └── package.html │ │ ├── package.html │ │ ├── ResultReader.java │ │ └── SQLWarningException.java │ └── object │ │ └── package.html │ ├── web │ ├── util │ │ ├── HtmlUtils.java │ │ ├── package.html │ │ └── Log4jConfigListener.java │ ├── servlet │ │ ├── view │ │ │ ├── xslt │ │ │ │ └── package.html │ │ │ ├── document │ │ │ │ └── package.html │ │ │ ├── velocity │ │ │ │ ├── package.html │ │ │ │ └── CommonsLoggingLogSystem.java │ │ │ └── package.html │ │ ├── handler │ │ │ ├── package.html │ │ │ └── UrlAwareHandler.java │ │ ├── i18n │ │ │ └── package.html │ │ ├── tags │ │ │ └── package.html │ │ ├── support │ │ │ └── package.html │ │ ├── package.html │ │ ├── theme │ │ │ └── FixedThemeResolver.java │ │ └── mvc │ │ │ └── multiaction │ │ │ └── NoSuchRequestHandlingMethodException.java │ ├── bind │ │ ├── package.html │ │ └── ServletRequestBindingException.java │ └── context │ │ ├── package.html │ │ ├── support │ │ └── package.html │ │ └── ContextLoaderListener.java │ ├── transaction │ ├── jta │ │ └── package.html │ ├── interceptor │ │ ├── package.html │ │ ├── NoRollbackRuleAttribute.java │ │ ├── TransactionAttribute.java │ │ ├── TransactionAttributeSource.java │ │ └── DefaultTransactionAttribute.java │ ├── package.html │ ├── support │ │ ├── package.html │ │ └── TransactionSynchronization.java │ ├── InvalidIsolationException.java │ ├── TransactionSystemException.java │ ├── TransactionUsageException.java │ ├── UnexpectedRollbackException.java │ ├── InvalidTimeoutException.java │ ├── TransactionException.java │ ├── CannotCreateTransactionException.java │ ├── NoTransactionException.java │ └── NestedTransactionNotPermittedException.java │ ├── core │ ├── package.html │ ├── TimeStamped.java │ ├── HasRootCause.java │ ├── InternalErrorException.java │ ├── ErrorCoded.java │ ├── Ordered.java │ └── OrderComparator.java │ ├── aop │ ├── attributes │ │ └── package.html │ ├── framework │ │ ├── package.html │ │ ├── ProxyInterceptor.java │ │ ├── AopConfigException.java │ │ ├── AopUtils.java │ │ ├── AlwaysInvoked.java │ │ ├── IntroductionInterceptor.java │ │ ├── MethodPointcut.java │ │ └── AbstractMethodPointcut.java │ └── interceptor │ │ ├── package.html │ │ ├── AbstractQaInterceptor.java │ │ ├── DebugInterceptor.java │ │ └── ClassLoaderAnalyzerInterceptor.java │ ├── validation │ └── package.html │ ├── util │ ├── package.html │ ├── ConstantException.java │ └── PagedListSourceProvider.java │ ├── orm │ ├── jdo │ │ ├── support │ │ │ └── package.html │ │ ├── package.html │ │ ├── JdoSystemException.java │ │ └── JdoUsageException.java │ └── hibernate │ │ ├── support │ │ └── package.html │ │ ├── package.html │ │ ├── HibernateJdbcException.java │ │ └── HibernateSystemException.java │ ├── remoting │ ├── support │ │ ├── package.html │ │ └── AuthorizableRemoteProxyFactoryBean.java │ ├── package.html │ ├── rmi │ │ ├── package.html │ │ ├── RemoteInvocationHandler.java │ │ └── RemoteInvocationWrapper.java │ └── caucho │ │ └── package.html │ ├── beans │ ├── factory │ │ ├── xml │ │ │ └── package.html │ │ ├── support │ │ │ ├── package.html │ │ │ ├── BootstrapException.java │ │ │ ├── ManagedList.java │ │ │ ├── ManagedMap.java │ │ │ ├── CxsFactory.java │ │ │ ├── BeanFactoryLoader.java │ │ │ └── RuntimeBeanReference.java │ │ ├── package.html │ │ ├── HierarchicalBeanFactory.java │ │ ├── BeanDefinitionStoreException.java │ │ ├── BeanIsNotAFactoryException.java │ │ ├── DisposableBean.java │ │ └── NoSuchBeanDefinitionException.java │ ├── propertyeditors │ │ ├── package.html │ │ ├── ClassEditor.java │ │ ├── StringArrayPropertyEditor.java │ │ └── LocaleEditor.java │ ├── NotWritablePropertyException.java │ ├── SortDefinition.java │ ├── package.html │ ├── TypeMismatchException.java │ ├── FatalBeanException.java │ ├── PropertyAccessException.java │ ├── BeansException.java │ └── NullValueInNestedPathException.java │ ├── context │ ├── support │ │ ├── package.html │ │ ├── ContextClosedEvent.java │ │ ├── ContextRefreshedEvent.java │ │ ├── ConsoleListener.java │ │ └── MessageSourceResourceBundle.java │ ├── NestingMessageSource.java │ ├── package.html │ ├── ApplicationContextException.java │ ├── NoSuchMessageException.java │ ├── ApplicationEventMulticaster.java │ ├── ApplicationListener.java │ └── MessageSourceResolvable.java │ ├── ui │ └── context │ │ ├── support │ │ ├── package.html │ │ └── SimpleTheme.java │ │ ├── NestingThemeSource.java │ │ ├── ThemeSource.java │ │ └── Theme.java │ ├── jndi │ ├── support │ │ └── package.html │ └── package.html │ ├── dao │ ├── package.html │ ├── DeadlockLoserDataAccessException.java │ ├── TypeMismatchDataAccessException.java │ ├── DataAccessResourceFailureException.java │ └── DataIntegrityViolationException.java │ └── ejb │ ├── support │ ├── AbstractJmsMessageDrivenBean.java │ ├── AbstractStatefulSessionBean.java │ └── package.html │ └── access │ └── AbstractRemoteSlsbInvokerInterceptor.java ├── sandbox └── com │ └── interface21 │ ├── samples │ └── crud │ │ └── web │ │ ├── SirenesControleur.jav │ │ ├── AdminUtilisateursControleur.jav │ │ ├── fax.jsp │ │ ├── nom.jsp │ │ ├── tel.jsp │ │ ├── email.jsp │ │ ├── desc.jsp │ │ ├── pays.jsp │ │ └── crud-servet.xml │ ├── web │ └── servlet │ │ └── mvc │ │ ├── AbstractListFormController.java │ │ └── AbstractParamListFormController.java │ ├── aop │ └── interceptor │ │ └── EventPublicationInterceptor.java │ └── core │ └── NodeCountVisitor.java └── .idea ├── vcs.xml ├── smartfox_info.xml ├── libraries ├── lib.xml └── aopalliance.xml ├── junitgenerator-prj-settings.xml ├── modules.xml └── misc.xml /samples/petclinic/db/hsqldb/petclinic.data: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples/countries/warfile.bat: -------------------------------------------------------------------------------- 1 | .\ant.bat warfile -------------------------------------------------------------------------------- /samples/countries/lib/content.txt: -------------------------------------------------------------------------------- 1 | Nothing here for now. -------------------------------------------------------------------------------- /test/com/interface21/orm/jdo/test.properties: -------------------------------------------------------------------------------- 1 | myKey=myValue 2 | -------------------------------------------------------------------------------- /test/com/interface21/web/context/WEB-INF/theme_en_GB.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/views/jsp/countries/main/detailnav.jsp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples/petclinic/db/hsqldb/server.properties: -------------------------------------------------------------------------------- 1 | server.trace=true 2 | -------------------------------------------------------------------------------- /samples/petclinic/db/mysql/dropDB.txt: -------------------------------------------------------------------------------- 1 | DROP DATABASE petclinic; 2 | -------------------------------------------------------------------------------- /samples/countries/as/jboss/install.txt: -------------------------------------------------------------------------------- 1 | The file has to be put in WEB-INF directory. -------------------------------------------------------------------------------- /lib/ant/ant.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/ant/ant.jar -------------------------------------------------------------------------------- /lib/j2ee/ejb.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/j2ee/ejb.jar -------------------------------------------------------------------------------- /lib/j2ee/jms.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/j2ee/jms.jar -------------------------------------------------------------------------------- /lib/j2ee/jta.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/j2ee/jta.jar -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/classes/none.properties: -------------------------------------------------------------------------------- 1 | css= 2 | img-back=/images/back.gif -------------------------------------------------------------------------------- /test/com/interface21/web/context/WEB-INF/test-messages.properties: -------------------------------------------------------------------------------- 1 | code2=message2 2 | -------------------------------------------------------------------------------- /docs/tutorial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/docs/tutorial.pdf -------------------------------------------------------------------------------- /lib/jdo/jdo1_0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/jdo/jdo1_0.jar -------------------------------------------------------------------------------- /lib/jstl/jstl.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/jstl/jstl.jar -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/classes/blue_de.properties: -------------------------------------------------------------------------------- 1 | img-back=/themes/blue/bback_de.gif -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/classes/blue_en.properties: -------------------------------------------------------------------------------- 1 | img-back=/themes/blue/bback_en.gif -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/classes/blue_fr.properties: -------------------------------------------------------------------------------- 1 | img-back=/themes/blue/bback_fr.gif -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/classes/theme_de.properties: -------------------------------------------------------------------------------- 1 | img-back=/themes/white/wback_de.gif -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/classes/theme_en.properties: -------------------------------------------------------------------------------- 1 | img-back=/themes/white/wback_en.gif -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/classes/theme_fr.properties: -------------------------------------------------------------------------------- 1 | img-back=/themes/white/wback_fr.gif -------------------------------------------------------------------------------- /lib/clover/clover.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/clover/clover.jar -------------------------------------------------------------------------------- /lib/j2ee/servlet.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/j2ee/servlet.jar -------------------------------------------------------------------------------- /lib/j2ee/xml-apis.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/j2ee/xml-apis.jar -------------------------------------------------------------------------------- /lib/jstl/standard.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/jstl/standard.jar -------------------------------------------------------------------------------- /lib/junit/junit.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/junit/junit.jar -------------------------------------------------------------------------------- /samples/countries/as/jboss/3.0.x/install.txt: -------------------------------------------------------------------------------- 1 | The file has to be put in the JBoss deploy directory. -------------------------------------------------------------------------------- /samples/countries/as/jboss/3.2.x/install.txt: -------------------------------------------------------------------------------- 1 | The file has to be put in the JBoss deploy directory. -------------------------------------------------------------------------------- /test/com/interface21/web/context/WEB-INF/test-theme.properties: -------------------------------------------------------------------------------- 1 | theme.example2=test-message2 2 | -------------------------------------------------------------------------------- /lib/cglib/bcel-5.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/cglib/bcel-5.1.jar -------------------------------------------------------------------------------- /lib/cglib/cglib-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/cglib/cglib-1.0.jar -------------------------------------------------------------------------------- /lib/hibernate/dom4j.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/hibernate/dom4j.jar -------------------------------------------------------------------------------- /lib/itext-pdf/iText.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/itext-pdf/iText.jar -------------------------------------------------------------------------------- /samples/petclinic/as/jboss/3.2.x/install.txt: -------------------------------------------------------------------------------- 1 | The files have to be put in the JBoss deploy directory. -------------------------------------------------------------------------------- /samples/petclinic/db/hsqldb/manager.bat: -------------------------------------------------------------------------------- 1 | java -cp hsqldb.jar org.hsqldb.util.DatabaseManager 2 | 3 | -------------------------------------------------------------------------------- /lib/easymock/easymock.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/easymock/easymock.jar -------------------------------------------------------------------------------- /lib/log4j/log4j-1.2.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/log4j/log4j-1.2.8.jar -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/views/jsp/countries/top.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="../common/includes.jsp" %> 2 | -------------------------------------------------------------------------------- /samples/petclinic/db/hsqldb/manager.sh: -------------------------------------------------------------------------------- 1 | java -cp ../../lib/hsqldb.jar org.hsqldb.util.DatabaseManager 2 | -------------------------------------------------------------------------------- /xdocs/images/logo-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/xdocs/images/logo-blue.png -------------------------------------------------------------------------------- /lib/caucho/burlap-2.1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/caucho/burlap-2.1.7.jar -------------------------------------------------------------------------------- /lib/caucho/hessian-2.1.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/caucho/hessian-2.1.7.jar -------------------------------------------------------------------------------- /lib/hibernate/hibernate2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/hibernate/hibernate2.jar -------------------------------------------------------------------------------- /lib/j2ee/jdbc2_0-stdext.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/j2ee/jdbc2_0-stdext.jar -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/classes/messages_en.properties: -------------------------------------------------------------------------------- 1 | # All english properties are in main properties file. -------------------------------------------------------------------------------- /src/com/interface21/jdbc/util/package.html: -------------------------------------------------------------------------------- 1 |
Contains miscellaneous JDBC utilities. -------------------------------------------------------------------------------- /lib/hibernate/commons-lang.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/hibernate/commons-lang.jar -------------------------------------------------------------------------------- /lib/log4j/commons-logging.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/log4j/commons-logging.jar -------------------------------------------------------------------------------- /lib/velocity/velocity-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/velocity/velocity-1.3.jar -------------------------------------------------------------------------------- /samples/countries/db/hsqldb.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/db/hsqldb.jar -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/classes/blue.properties: -------------------------------------------------------------------------------- 1 | css=/themes/blue/blue.css 2 | img-back=/themes/blue/bback_en.gif -------------------------------------------------------------------------------- /samples/petclinic/db/hsqldb/server.bat: -------------------------------------------------------------------------------- 1 | java -classpath ..\..\lib\hsqldb.jar org.hsqldb.Server -database petclinic 2 | -------------------------------------------------------------------------------- /samples/petclinic/db/hsqldb/server.sh: -------------------------------------------------------------------------------- 1 | java -classpath ../../lib/hsqldb.jar org.hsqldb.Server -database petclinic 2 | -------------------------------------------------------------------------------- /test/com/interface21/web/context/WEB-INF/myinit.properties: -------------------------------------------------------------------------------- 1 | father.name=Albert 2 | rod.age=31 3 | rod.name=Roderick 4 | -------------------------------------------------------------------------------- /lib/aop-alliance/aopalliance.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/aop-alliance/aopalliance.jar -------------------------------------------------------------------------------- /lib/poi/poi-2.0-pre3-20030728.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/poi/poi-2.0-pre3-20030728.jar -------------------------------------------------------------------------------- /lib/regexp/jakarta-oro-2.0.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/regexp/jakarta-oro-2.0.7.jar -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/classes/theme.properties: -------------------------------------------------------------------------------- 1 | css=/themes/white/white.css 2 | img-back=/themes/white/wback_en.gif -------------------------------------------------------------------------------- /samples/petclinic/lib/hsqldb.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/petclinic/lib/hsqldb.jar -------------------------------------------------------------------------------- /samples/countries/war/images/de.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/images/de.gif -------------------------------------------------------------------------------- /samples/countries/war/images/fr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/images/fr.gif -------------------------------------------------------------------------------- /samples/countries/war/images/us.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/images/us.gif -------------------------------------------------------------------------------- /lib/hibernate/commons-collections.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/hibernate/commons-collections.jar -------------------------------------------------------------------------------- /samples/countries/war/images/back.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/images/back.gif -------------------------------------------------------------------------------- /test/com/interface21/web/context/WEB-INF/theme_en_US.properties: -------------------------------------------------------------------------------- 1 | theme.example1=This is a test message in the theme message catalog. -------------------------------------------------------------------------------- /lib/mockobjects/mockobjects-0.07-core.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/mockobjects/mockobjects-0.07-core.jar -------------------------------------------------------------------------------- /docs/MVC-step-by-step/Spring-MVC-Step22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/docs/MVC-step-by-step/Spring-MVC-Step22.png -------------------------------------------------------------------------------- /lib/mockobjects/mockobjects-0.07-jdk1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/mockobjects/mockobjects-0.07-jdk1.3.jar -------------------------------------------------------------------------------- /samples/countries/war/themes/blue/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/themes/blue/logo.gif -------------------------------------------------------------------------------- /samples/countries/war/themes/white/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/themes/white/logo.gif -------------------------------------------------------------------------------- /src/com/interface21/web/util/HtmlUtils.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/src/com/interface21/web/util/HtmlUtils.java -------------------------------------------------------------------------------- /samples/countries/war/themes/blue/bback_de.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/themes/blue/bback_de.gif -------------------------------------------------------------------------------- /samples/countries/war/themes/blue/bback_en.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/themes/blue/bback_en.gif -------------------------------------------------------------------------------- /samples/countries/war/themes/blue/bback_fr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/themes/blue/bback_fr.gif -------------------------------------------------------------------------------- /src/com/interface21/transaction/jta/package.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Transaction SPI implementation for JTA. 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /samples/countries/war/themes/white/wback_de.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/themes/white/wback_de.gif -------------------------------------------------------------------------------- /samples/countries/war/themes/white/wback_en.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/themes/white/wback_en.gif -------------------------------------------------------------------------------- /samples/countries/war/themes/white/wback_fr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/themes/white/wback_fr.gif -------------------------------------------------------------------------------- /lib/mockobjects/mockobjects-0.07-j1.3-j2ee1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/lib/mockobjects/mockobjects-0.07-j1.3-j2ee1.3.jar -------------------------------------------------------------------------------- /test/com/interface21/beans/IOther.java: -------------------------------------------------------------------------------- 1 | 2 | package com.interface21.beans; 3 | 4 | public interface IOther { 5 | 6 | void absquatulate(); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /test/com/interface21/web/servlet/view/BaseViewTests.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/test/com/interface21/web/servlet/view/BaseViewTests.java -------------------------------------------------------------------------------- /samples/petclinic/lib/mysql-connector-java-2.0.14-bin.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/petclinic/lib/mysql-connector-java-2.0.14-bin.jar -------------------------------------------------------------------------------- /test/com/interface21/web/context/WEB-INF/theme.properties: -------------------------------------------------------------------------------- 1 | theme.example1=This is a test message in the theme message catalog with no args. 2 | theme.example2=message2 3 | -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/classes/messages_de.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/WEB-INF/classes/messages_de.properties -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/classes/messages_fr.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stateIs0/interface21/HEAD/samples/countries/war/WEB-INF/classes/messages_fr.properties -------------------------------------------------------------------------------- /samples/countries/war/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page session="false"%> 2 | <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> 3 | 4 |11 | -------------------------------------------------------------------------------- /src/com/interface21/jndi/support/package.html: -------------------------------------------------------------------------------- 1 |
The simplest implementation of the JNDI SPI that could possibly work.Useful for setting up a simple JNDI environment for test suites
or standalone applications. If e.g. JDBC DataSources get bound to the
same JNDI names as within a J2EE container, both application code and
configuration can me reused without changes.
--------------------------------------------------------------------------------
/samples/petclinic/war/WEB-INF/jsp/fields/address.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="/WEB-INF/jsp/includes.jsp" %>
2 |
3 | Address:
4 |
" >
9 |
11 |
--------------------------------------------------------------------------------
/samples/petclinic/war/WEB-INF/jsp/fields/firstName.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="/WEB-INF/jsp/includes.jsp" %>
2 |
3 | First Name:
4 |
" >
9 |
11 |
--------------------------------------------------------------------------------
/samples/petclinic/war/WEB-INF/jsp/fields/lastName.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="/WEB-INF/jsp/includes.jsp" %>
2 |
3 | Last Name:
4 |
" >
9 |
11 |
--------------------------------------------------------------------------------
/samples/petclinic/war/WEB-INF/jsp/fields/telephone.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="/WEB-INF/jsp/includes.jsp" %>
2 |
3 | Telephone:
4 |
" >
9 |
11 | -------------------------------------------------------------------------------- /sandbox/com/interface21/samples/crud/web/fax.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/WEB-INF/vues/jsp/commun/includes.jsp" %> 2 |
3 |
3 |
3 |
3 |
3 |
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). -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/views/jsp/countries/copy.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="../common/includes.jsp" %> 2 | 3 |
5 |
7 | ">Display all veterinarians 8 |
11 | ">Documentation 12 | 13 | -------------------------------------------------------------------------------- /samples/petclinic/db/hsqldb/petclinic.properties: -------------------------------------------------------------------------------- 1 | #HSQL database 2 | #Mon Jun 23 15:34:42 CEST 2003 3 | sql.strict_fk=true 4 | readonly=false 5 | sql.strong_fk=true 6 | hsqldb.version=1.7.1 7 | version=1.7.1 8 | hsqldb.cache_scale=14 9 | sql.compare_in_locale=false 10 | sql.month=true 11 | hsqldb.log_size=200 12 | modified=yes 13 | hsqldb.cache_version=1.7.0 14 | hsqldb.original_version=1.7.1 15 | hsqldb.compatible_version=1.7.0 16 | sql.enforce_size=false 17 | -------------------------------------------------------------------------------- /samples/countries/src/com/interface21/samples/countries/appli/ICountry.java: -------------------------------------------------------------------------------- 1 | package com.interface21.samples.countries.appli; 2 | 3 | /** 4 | * @author Jean-Pierre PAWLAK 5 | */ 6 | public interface ICountry { 7 | 8 | //~ Methods ---------------------------------------------------------------- 9 | 10 | public String getName(); 11 | 12 | public String getCode(); 13 | 14 | public void setName(String nom); 15 | 16 | public void setCode(String code); 17 | } 18 | -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/views/jsp/errors/http404.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="../common/includes.jsp" %> 2 | 3 | 6 |
This package and related packages are discussed in Chapter 11 of
Expert One-On-One J2EE Design and Development
by Rod Johnson (Wrox, 2002).
--------------------------------------------------------------------------------
/src/com/interface21/orm/jdo/JdoSystemException.java:
--------------------------------------------------------------------------------
1 | package com.interface21.orm.jdo;
2 |
3 | import com.interface21.dao.UncategorizedDataAccessException;
4 |
5 | /**
6 | * JDO exception that gets thrown on system errors.
7 | * @author Juergen Hoeller
8 | * @since 03.06.2003
9 | */
10 | public class JdoSystemException extends UncategorizedDataAccessException {
11 |
12 | public JdoSystemException(String s, Throwable ex) {
13 | super(s, ex);
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/com/interface21/orm/jdo/JdoUsageException.java:
--------------------------------------------------------------------------------
1 | package com.interface21.orm.jdo;
2 |
3 | import com.interface21.dao.InvalidDataAccessApiUsageException;
4 |
5 | /**
6 | * JDO exception that gets thrown on invalid API usage.
7 | * @author Juergen Hoeller
8 | * @since 03.06.2003
9 | */
10 | public class JdoUsageException extends InvalidDataAccessApiUsageException {
11 |
12 | public JdoUsageException(String s, Throwable ex) {
13 | super(s, ex);
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/test/com/interface21/beans/ITestBean.java:
--------------------------------------------------------------------------------
1 |
2 | package com.interface21.beans;
3 |
4 | public interface ITestBean {
5 |
6 | int getAge();
7 |
8 | void setAge(int age);
9 |
10 | String getName();
11 |
12 | void setName(String name);
13 |
14 | ITestBean getSpouse();
15 |
16 | void setSpouse(ITestBean spouse);
17 |
18 | /**
19 | * t null no error
20 | */
21 | void exceptional(Throwable t) throws Throwable;
22 |
23 | Object returnsThis();
24 |
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/test/com/interface21/beans/factory/support/leaf.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
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. 用于将字符串值转换为对象的属性编辑器 类型,如java.util.Properties。
其中一些编辑器由BeanWrapperImpl自动注册。 “CustomXxxEditor”类用于手动注册 特定的结合过程,因为它们是本地化的等。 -------------------------------------------------------------------------------- /src/com/interface21/core/TimeStamped.java: -------------------------------------------------------------------------------- 1 | 2 | package com.interface21.core; 3 | 4 | /** 5 | * This interface can be implemented by cacheable objects 6 | * or cache entries, to enable the freshness of objects 7 | * to be checked. 8 | * @author Rod Johnson 9 | */ 10 | public interface TimeStamped { 11 | 12 | /** 13 | * Return the timestamp for this object 14 | * @return long the timestamp for this object, 15 | * as returned by System.currentTimeMillis() 16 | */ 17 | long getTimeStamp(); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/com/interface21/beans/factory/support/BootstrapException.java: -------------------------------------------------------------------------------- 1 | package com.interface21.beans.factory.support; 2 | 3 | import com.interface21.beans.FatalBeanException; 4 | 5 | /** 6 | * 7 | * @author Rod Johnson 8 | * @since 02-Dec-02 9 | */ 10 | public class BootstrapException extends FatalBeanException { 11 | 12 | /** 13 | * Constructor for BootstrapException. 14 | * @param msg 15 | * @param t 16 | */ 17 | public BootstrapException(String msg, Throwable t) { 18 | super(msg, t); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/com/interface21/beans/factory/support/ManagedList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The Spring Framework is published under the terms 3 | * of the Apache Software License. 4 | */ 5 | 6 | package com.interface21.beans.factory.support; 7 | 8 | import java.util.LinkedList; 9 | 10 | /** 11 | * Tag subclass used to hold managed elements, which may 12 | * include runtime bean references 13 | * @author Rod Johnson 14 | * @since 27-May-2003 15 | * @version $Id$ 16 | */ 17 | public class ManagedList extends LinkedList { 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/com/interface21/transaction/InvalidIsolationException.java: -------------------------------------------------------------------------------- 1 | package com.interface21.transaction; 2 | 3 | /** 4 | * Exception that gets thrown when an invalid isolation level is specified, 5 | * i.e. an isolation level that the transaction manager implementation 6 | * doesn't support. 7 | * @author Juergen Hoeller 8 | * @since 12.05.2003 9 | */ 10 | public class InvalidIsolationException extends TransactionUsageException { 11 | 12 | public InvalidIsolationException(String msg) { 13 | super(msg); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /test/com/interface21/beans/factory/KnowsIfInstantiated.java: -------------------------------------------------------------------------------- 1 | 2 | package com.interface21.beans.factory; 3 | 4 | public class KnowsIfInstantiated { 5 | 6 | private static boolean instantiated; 7 | 8 | public static void clearInstantiationRecord() { 9 | instantiated = false; 10 | } 11 | 12 | public static boolean wasInstantiated() { 13 | return instantiated; 14 | } 15 | 16 | /** 17 | * Constructor for KnowsIfLoaded. 18 | */ 19 | public KnowsIfInstantiated() { 20 | instantiated = true; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /samples/countries/war/WEB-INF/views/jsp/countries/main/detail.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="../../common/includes.jsp" %> 2 | 3 |
5 |
In particular, application classes using this package do not need to catch naming exceptions or obtain JNDI contexts.
The classes in this package are discussed in Chapter 11 of
Expert One-On-One J2EE Design and Development
by Rod Johnson (Wrox, 2002).
--------------------------------------------------------------------------------
/src/com/interface21/aop/framework/ProxyInterceptor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The Spring Framework is published under the terms
3 | * of the Apache Software License.
4 | */
5 |
6 | package com.interface21.aop.framework;
7 |
8 | import org.aopalliance.intercept.Interceptor;
9 |
10 | /**
11 | * Interface to be implemented by interceptors that have
12 | * a proxy target.
13 | * @author Rod Johnson
14 | * @since 14-Mar-2003
15 | * @version $Revision$
16 | */
17 | public interface ProxyInterceptor extends Interceptor {
18 |
19 | Object getTarget();
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/src/com/interface21/beans/factory/support/ManagedMap.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The Spring Framework is published under the terms
3 | * of the Apache Software License.
4 | */
5 |
6 | package com.interface21.beans.factory.support;
7 |
8 | import java.util.HashMap;
9 |
10 | /**
11 | * Tag subclass used to hold managed values, which may
12 | * include runtime bean references
13 | *
14 | * 标记子类用于保存托管值,可以包括运行时bean引用
15 | *
16 | * @author Rod Johnson
17 | * @since 27-May-2003
18 | * @version $Id$
19 | */
20 | public class ManagedMap extends HashMap {
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/samples/petclinic/as/jboss/jboss-web.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Application developers don't usually need to implement views, 8 | as the framework provides standard views for JSPs, Velocity, 9 | XSLT, etc. However, the ability to implement custom views easily 10 | by subclassing the AbstractView class in this package can be 11 | very helpful if an application has unusual view requirements. 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sandbox/com/interface21/samples/crud/web/pays.jsp: -------------------------------------------------------------------------------- 1 | <%@ include file="/WEB-INF/vues/jsp/commun/includes.jsp" %> 2 |
3 |
12 | Spring's main goal is to provide a framework which simplifies the development of J2EE 13 | applications. To achieve this it addresses issues such as: 14 |
14 | This document contains the latest news and status reports from the 15 | Spring Framework project. 16 |
17 | 18 |20 | No news yet. 21 |
22 |5 |
version
4 |
11 |
15 |
19 |
12 |
20 | ">Home
21 |
--------------------------------------------------------------------------------
/test/com/interface21/beans/factory/xml/invalid.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
19 |
4 |
| Name | Specialties | 7 |
|---|---|
|
11 | |
15 |
19 | 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).
--------------------------------------------------------------------------------
/test/com/interface21/context/BeanThatListens.java:
--------------------------------------------------------------------------------
1 |
2 | package com.interface21.context;
3 |
4 | /**
5 | * Add as a bean. Should also listen.
6 | */
7 | public class BeanThatListens implements ApplicationListener {
8 |
9 | private int events;
10 |
11 | /**
12 | * Constructor for BeanThatListeners.
13 | */
14 | public BeanThatListens() {
15 | super();
16 | }
17 |
18 | public void zero() {
19 | events = 0;
20 | }
21 |
22 | /**
23 | * @see ApplicationListener#onApplicationEvent(ApplicationEvent)
24 | */
25 | public void onApplicationEvent(ApplicationEvent e) {
26 | ++events;
27 | //System.out.println("Bean that listens heard event");
28 | }
29 |
30 | public int getEventCount() {
31 | return events;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/com/interface21/ui/context/NestingThemeSource.java:
--------------------------------------------------------------------------------
1 | package com.interface21.ui.context;
2 |
3 | /**
4 | * Subinterface of ThemeSource to be implemented by objects that
5 | * can resolve messages hierarchically.
6 | * @author Rod Johnson
7 | * @author Jean-Pierre Pawlak
8 | * @version $RevisionId$
9 | */
10 | public interface NestingThemeSource extends ThemeSource {
11 |
12 | /**
13 | * Set the parent that will be used to try to resolve theme messages
14 | * that this object can't resolve.
15 | * @param parent parent ThemeSource that will be used to
16 | * resolve messages that this object can't resolve.
17 | * May be null, in which case no further resolution is possible.
18 | */
19 | void setParent(ThemeSource parent);
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/test/com/interface21/beans/factory/support/middle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | This higher level of JDBC abstraction depends on the lower-level
abstraction in the com.interface21.jdbc.core package. Exceptions
thrown are as in the com.interface21.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).
--------------------------------------------------------------------------------
/src/com/interface21/beans/package.html:
--------------------------------------------------------------------------------
1 |
2 | A BeanWrapper object may be used to set and get bean properties,
8 | singly or in bulk.
9 |
10 | The classes in this package are discussed in Chapter 11 of
11 | Expert One-On-One J2EE Design and Development
12 | by Rod Johnson (Wrox, 2002).
13 |
14 | 该包包含用于操作Java bean的接口和类。
15 | 它被大多数其他Spring包使用。 BeanWrapper对象可用于设置和获取bean属性,
16 | 单独或批量。 此包中的类将在第11章中讨论
17 | Expert One-On-One J2EE设计与开发
18 | 作者:Rod Johnson(Wrox,2002)。
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/test/com/interface21/jdbc/mock/SpringMockStatement.java:
--------------------------------------------------------------------------------
1 | package com.interface21.jdbc.mock;
2 |
3 | import java.sql.SQLException;
4 | import java.sql.SQLWarning;
5 |
6 | import com.mockobjects.sql.MockStatement;
7 |
8 | /**
9 | * Warning support should really be in Mock objects core
10 | *
11 | * (c) Rod Johnson, 2003
12 | * @author Rod Johnson
13 | */
14 | public class SpringMockStatement extends MockStatement {
15 |
16 | private SQLWarning warning;
17 |
18 |
19 | public void setupReportWarningOnExecute(SQLWarning warnings) {
20 | this.warning = warnings;
21 | }
22 |
23 | /**
24 | * @see java.sql.Statement#getWarnings()
25 | */
26 | public SQLWarning getWarnings() throws SQLException {
27 | // CHECK NOT BEFORE execute?
28 |
29 | return this.warning;
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/com/interface21/context/support/ConsoleListener.java:
--------------------------------------------------------------------------------
1 | package com.interface21.context.support;
2 |
3 | import com.interface21.context.ApplicationEvent;
4 | import com.interface21.context.ApplicationListener;
5 |
6 | /**
7 | * Simple listener for debug use only that logs messages
8 | * to the console.
9 | *
10 | * Note: The ApplicationContext implementations included
11 | * in the framework do quite heavy debug-level logging via
12 | * Log4J, including published events. Thus, this listener
13 | * isn't necessary for debug logging.
14 | *
15 | * @author Rod Johnson
16 | * @since January 21, 2001
17 | */
18 | public class ConsoleListener implements ApplicationListener {
19 |
20 | public void onApplicationEvent(ApplicationEvent e) {
21 | System.out.println(e.toString());
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/com/interface21/ui/context/support/SimpleTheme.java:
--------------------------------------------------------------------------------
1 | package com.interface21.ui.context.support;
2 |
3 | import com.interface21.ui.context.Theme;
4 | import com.interface21.context.MessageSource;
5 |
6 | /**
7 | * Default Theme implementation, wrapping a name and an
8 | * underlying MessageSource.
9 | * @author Juergen Hoeller
10 | * @since 17.06.2003
11 | */
12 | public class SimpleTheme implements Theme {
13 |
14 | private String name;
15 |
16 | private MessageSource messageSource;
17 |
18 | public SimpleTheme(String name, MessageSource messageSource) {
19 | this.name = name;
20 | this.messageSource = messageSource;
21 | }
22 |
23 | public String getName() {
24 | return name;
25 | }
26 |
27 | public MessageSource getMessageSource() {
28 | return messageSource;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/xdocs/index.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 | Spring is a framework for developing J2EE applications. It is based on the code published in the book
15 | Expert One-on-One J2EE Design and Development written by
16 | Rod Johnson. It includes code for JavaBeans-based configuration management and a JDBC abstraction layer.
17 |
19 | There is no necessity for Spring applications to depend
10 | on ApplicationContext or even BeanFactory functionality
11 | explicitly. One of the strengths of the Spring architecture
12 | is that application objects can often be configured without
13 | any dependency on Spring-specific APIs.
14 |
15 | 这个包构建在beans包之上,以增加对它的支持
16 | 消息源和Observer设计模式,以及
17 | 应用程序对象使用a获取资源的能力
18 | 一致的API。
19 |
20 | Spring应用程序无需依赖
21 | 在ApplicationContext甚至BeanFactory功能上
22 | 明确。 Spring架构的优势之一
23 | 是应用程序对象通常可以配置没有
24 | 对Spring特定API的任何依赖。
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/xdocs/navigation.xml:
--------------------------------------------------------------------------------
1 |
2 | This package and related packages are discussed in Chapter 9 of
Expert One-On-One J2EE Design and Development
by Rod Johnson (Wrox, 2002).
--------------------------------------------------------------------------------
/samples/skeletons/webapp-typical/WEB-INF/classes/views.properties:
--------------------------------------------------------------------------------
1 | # Sample Spring view definitions
2 |
3 | # For English language (default)
4 |
5 | # Standard ResourceBundle syntax applies
6 |
7 | # Format is
8 | # viewName.class=
4 |
11 |
25 | Note: This listener should be placed before ContextLoaderListener
11 | * in web.xml, when using custom Log4J initialization.
12 | *
13 | * @author Juergen Hoeller
14 | * @since 13.03.2003
15 | * @see com.interface21.web.util.Log4jWebConfigurer
16 | * @see WebAppRootListener
17 | */
18 | public class Log4jConfigListener implements ServletContextListener {
19 |
20 | public void contextInitialized(ServletContextEvent event) {
21 | Log4jWebConfigurer.initLogging(event.getServletContext());
22 | }
23 |
24 | public void contextDestroyed(ServletContextEvent event) {
25 | Log4jWebConfigurer.shutdownLogging(event.getServletContext());
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/test/com/interface21/context/TestListener.java:
--------------------------------------------------------------------------------
1 | package com.interface21.context;
2 |
3 |
4 | /**
5 | * Listener that maintains a global count
6 | * of events.
7 | * @author Rod Johnson
8 | * @since January 21, 2001
9 | */
10 | public class TestListener implements ApplicationListener {
11 |
12 | // static?
13 | private int eventCount;
14 |
15 | public int getEventCount() {
16 | return eventCount;
17 | }
18 |
19 | public void zeroCounter() {
20 | eventCount = 0;
21 | }
22 |
23 | public TestListener() {
24 | }
25 |
26 |
27 | //---------------------------------------------------------------------
28 | // Implementation of WebApplicationListener
29 | //---------------------------------------------------------------------
30 | /**
31 | * Ignore log events
32 | */
33 | public void onApplicationEvent(ApplicationEvent e) {
34 | //System.out.println("onApplicationEvent of class " + e.getClass().getName());
35 | ++eventCount;
36 | }
37 |
38 | } // class TestListener
39 |
--------------------------------------------------------------------------------
/src/com/interface21/aop/framework/IntroductionInterceptor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The Spring Framework is published under the terms
3 | * of the Apache Software License.
4 | */
5 |
6 | package com.interface21.aop.framework;
7 |
8 | import org.aopalliance.intercept.MethodInterceptor;
9 |
10 | /**
11 | * Subinterface of MethodInterceptor that allows additional
12 | * interfaces to be implemented by the interceptor, and available
13 | * via a proxy using that interceptor. This is commonly
14 | * referred to as introduction.
15 | * DefaultProxyConfig and subclasses will automatically recognise
16 | * introduction interceptors and expose any interfaces they
17 | * introduce.
18 | * @see DefaultProxyConfig
19 | * @author Rod Johnson
20 | * @version $Id$
21 | */
22 | public interface IntroductionInterceptor extends MethodInterceptor {
23 |
24 | /**
25 | * Return the introduced interfaces added by this object
26 | * @return Class[]
27 | */
28 | Class[] getIntroducedInterfaces();
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/com/interface21/transaction/interceptor/TransactionAttributeSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The Spring Framework is published under the terms
3 | * of the Apache Software License.
4 | */
5 |
6 | package com.interface21.transaction.interceptor;
7 |
8 | import org.aopalliance.intercept.MethodInvocation;
9 |
10 | /**
11 | * Interface used by TransactionInterceptor. Implementations know
12 | * how to source transaction attributes, whether from configuration,
13 | * metadata attributes at source level, or anywhere else.
14 | * @author Rod Johnson
15 | * @since 15-Apr-2003
16 | * @version $Id$
17 | */
18 | public interface TransactionAttributeSource {
19 |
20 | /**
21 | * Return the transaction attribute for this method.
22 | * Return null if the method is non-transactional.
23 | * @param invocation method invocation descriptor
24 | * @return TransactionAttribute transaction attribute or null.
25 | */
26 | TransactionAttribute getTransactionAttribute(MethodInvocation invocation);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/com/interface21/web/servlet/theme/FixedThemeResolver.java:
--------------------------------------------------------------------------------
1 | package com.interface21.web.servlet.theme;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.http.HttpServletResponse;
5 |
6 |
7 | /**
8 | * Implementation of ThemeResolver that simply uses a fixed theme.
9 | * The fixed name can be defined via the defaultTheme property.
10 | *
11 | * Note: Does not support setThemeName, as the theme is fixed.
12 | *
13 | * @author Jean-Pierre Pawlak
14 | * @author Juergen Hoeller
15 | * @since 17.06.2003
16 | * @see #setDefaultThemeName
17 | */
18 | public class FixedThemeResolver extends AbstractThemeResolver {
19 |
20 | public String resolveThemeName(HttpServletRequest request) {
21 | return getDefaultThemeName();
22 | }
23 |
24 | public void setThemeName(HttpServletRequest request, HttpServletResponse response, String themeName) {
25 | throw new IllegalArgumentException("Cannot change theme - use a different theme resolution strategy");
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/samples/countries/war/WEB-INF/views/jsp/countries/main/nav.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="../../common/includes.jsp" %>
2 |
3 | This interface is necessary because both runtime and checked
11 | * exceptions are useful, and they cannot share a common,
12 | * framework-specific, superclass.
13 | *
14 | * @author Rod Johnson
15 | * @version $Id$
16 | * @see com.interface21.context.MessageSource
17 | */
18 | public interface ErrorCoded {
19 |
20 | /**
21 | * Return the error code associated with this failure.
22 | * The GUI can render this anyway it pleases, allowing for Int8ln etc.
23 | * @return a String error code associated with this failure,
24 | * or null if not error-coded
25 | */
26 | String getErrorCode();
27 |
28 | }
29 |
30 |
--------------------------------------------------------------------------------
/src/com/interface21/dao/DeadlockLoserDataAccessException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Generic framework code included with
3 | * Expert One-On-One J2EE Design and Development
4 | * by Rod Johnson (Wrox, 2002).
5 | * This code is free to use and modify.
6 | * Please contact rod.johnson@interface21.com
7 | * for commercial support.
8 | */
9 |
10 | package com.interface21.dao;
11 |
12 | /**
13 | * Generic exception thrown when the current process was
14 | * a deadlock loser, and its transaction rolled back.
15 | * @author Rod Johnson
16 | * @version $Id$
17 | */
18 | public class DeadlockLoserDataAccessException extends DataAccessException {
19 |
20 | /**
21 | * Constructor for DeadlockLoserDataAccessException.
22 | * @param msg mesg
23 | * @param ex root cause
24 | */
25 | public DeadlockLoserDataAccessException(String msg, Throwable ex) {
26 | super(msg, ex);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/samples/countries/src/com/interface21/samples/countries/appli/Country.java:
--------------------------------------------------------------------------------
1 | package com.interface21.samples.countries.appli;
2 |
3 | /**
4 | * @author Jean-Pierre PAWLAK
5 | */
6 | public class Country implements ICountry {
7 |
8 | //~ Instance fields --------------------------------------------------------
9 |
10 | private String code;
11 | private String name;
12 |
13 | //~ Constructors -----------------------------------------------------------
14 |
15 | public Country() {
16 | super();
17 | }
18 |
19 | public Country(String code, String name) {
20 | super();
21 | this.code = code;
22 | this.name = name;
23 | }
24 |
25 | //~ Methods ----------------------------------------------------------------
26 |
27 | public String getCode() {
28 | return code;
29 | }
30 |
31 | public String getName() {
32 | return name;
33 | }
34 |
35 | public void setCode(String code) {
36 | this.code = code;
37 | }
38 |
39 | public void setName(String name) {
40 | this.name = name;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/com/interface21/remoting/rmi/RemoteInvocationHandler.java:
--------------------------------------------------------------------------------
1 | package com.interface21.remoting.rmi;
2 |
3 | import java.rmi.Remote;
4 |
5 | /**
6 | * Interface for RemoteInvocationWrapper instances on the server.
7 | * A client's StubInvocationHandler uses a stub implementing this interface.
8 | *
9 | * @author Juergen Hoeller
10 | * @since 14.05.2003
11 | */
12 | interface RemoteInvocationHandler extends Remote {
13 |
14 | /**
15 | * Called by the StubInvocationHandler on each invocation.
16 | * Invokes the given method with the given parameters on the actual object.
17 | * @param methodName the name of the invoked method
18 | * @param paramTypes the method's parameter types.
19 | * @param params the method's parameters
20 | * @return the object returned from the invoked method, if any
21 | * @throws Exception in case of invocation or invocation target exceptions
22 | */
23 | public Object invokeRemote(String methodName, Class[] paramTypes, Object[] params) throws Exception;
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/samples/petclinic/src/petclinic/Entity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Entity.java
3 | *
4 | * Created on June 17, 2003, 8:52 AM
5 | */
6 |
7 | package petclinic;
8 |
9 | /**
10 | * Simple JavaBean business object with an id property.
11 | * Used as a base class for objects needing this property.
12 | *
13 | * @author Ken Krebs
14 | */
15 | public class Entity {
16 |
17 | /** Holds value of property id. */
18 | private int id;
19 |
20 | /** Getter for property id.
21 | * @return Value of property id.
22 | */
23 | public int getId() {
24 | return this.id;
25 | }
26 |
27 | /** Setter for property id.
28 | * @param id New value of property id.
29 | */
30 | public void setId(int id) {
31 | this.id = id;
32 | }
33 |
34 | /** Method to copy properties from another Higher value can be interpreted as lower priority,
23 | * consequently the first object has highest priority
24 | * (somewhat analogous to Servlet "load-on-startup" values).
25 | *
26 | * @return the order value
27 | */
28 | public int getOrder();
29 | }
30 |
--------------------------------------------------------------------------------
/src/com/interface21/web/servlet/mvc/multiaction/NoSuchRequestHandlingMethodException.java:
--------------------------------------------------------------------------------
1 | package com.interface21.web.servlet.mvc.multiaction;
2 |
3 | import javax.servlet.http.HttpServletRequest;
4 | import javax.servlet.ServletException;
5 |
6 | /**
7 | * Exception thrown when there's no request handling method for
8 | * this request.
9 | * @author Rod Johnson
10 | */
11 | public class NoSuchRequestHandlingMethodException extends ServletException {
12 |
13 | private String name;
14 |
15 | public NoSuchRequestHandlingMethodException(HttpServletRequest request) {
16 | super("No handling method can be found for request [" + request + "]");
17 | }
18 |
19 | public NoSuchRequestHandlingMethodException(String name, MultiActionController multiActionRequestController) {
20 | super(
21 | "No request handling method with name '" + name + "' in class " + multiActionRequestController.getClass().getName());
22 | this.name = name;
23 | }
24 |
25 | public String getName() {
26 | return name;
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/com/interface21/jdbc/core/ResultReader.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Generic framework code included with
3 | * Expert One-On-One J2EE Design and Development
4 | * by Rod Johnson (Wrox, 2002).
5 | * This code is free to use and modify.
6 | * Please contact rod.johnson@interface21.com
7 | * for commercial support.
8 | */
9 |
10 | package com.interface21.jdbc.core;
11 |
12 | import java.util.List;
13 |
14 |
15 | /**
16 | * Extension of RowCallbackHandler interfaces that saves the
17 | * accumulated results as a Collection.
18 | * @author Rod Johnson
19 | */
20 | public interface ResultReader extends RowCallbackHandler {
21 |
22 | /**
23 | * Return all results, disconnected from the JDBC ResultSet.
24 | * @return all results, disconnected from the JDBC ResultSet.
25 | * Never returns null; returns the empty collection if there
26 | * were no results.
27 | */
28 | List getResults();
29 |
30 | }
31 |
32 |
--------------------------------------------------------------------------------
/src/com/interface21/orm/hibernate/HibernateJdbcException.java:
--------------------------------------------------------------------------------
1 | package com.interface21.orm.hibernate;
2 |
3 | import net.sf.hibernate.JDBCException;
4 |
5 | import com.interface21.dao.UncategorizedDataAccessException;
6 |
7 | /**
8 | * Hibernate-specific subclass of DataAccessException, for JDBC exceptions
9 | * that Hibernate rethrew. Used by HibernateTemplate.
10 | *
11 | * Part of the general strategy to allow for using Hibernate within
12 | * application service implementations that just feature DataAccessException
13 | * in their interfaces. Clients of these services do not need to be aware of
14 | * the particular data access strategy used by the service implementations.
15 | *
16 | * @author Juergen Hoeller
17 | * @since 02.05.2003
18 | * @see HibernateTemplate
19 | * @see com.interface21.dao
20 | */
21 | public class HibernateJdbcException extends UncategorizedDataAccessException {
22 |
23 | public HibernateJdbcException(String s, JDBCException ex) {
24 | super(s, ex.getSQLException());
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/com/interface21/remoting/support/AuthorizableRemoteProxyFactoryBean.java:
--------------------------------------------------------------------------------
1 | package com.interface21.remoting.support;
2 |
3 | /**
4 | * Abstract subclass of RemoteProxyFactoryBean,
5 | * adding support for authorization via username and password.
6 | * @author Juergen Hoeller
7 | * @since 13.05.2003
8 | */
9 | public abstract class AuthorizableRemoteProxyFactoryBean extends RemoteProxyFactoryBean {
10 |
11 | private String username;
12 |
13 | private String password;
14 |
15 | /**
16 | * Set the username that this factory should use to access the backend service.
17 | */
18 | public void setUsername(String username) {
19 | this.username = username;
20 | }
21 |
22 | protected String getUsername() {
23 | return username;
24 | }
25 |
26 | /**
27 | * Set the password that this factory should use to access the backend service.
28 | */
29 | public void setPassword(String password) {
30 | this.password = password;
31 | }
32 |
33 | protected String getPassword() {
34 | return password;
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/src/com/interface21/beans/BeansException.java:
--------------------------------------------------------------------------------
1 | package com.interface21.beans;
2 |
3 | import com.interface21.core.NestedRuntimeException;
4 |
5 | /**
6 | * Abstract superclass for all exceptions thrown in the beans package
7 | * and subpackages. Note that this is a runtime (unchecked) exception.
8 | * Beans exceptions are usually fatal; there is no reason for them to be
9 | * checked.
10 | * @author Rod Johnson
11 | */
12 | public abstract class BeansException extends NestedRuntimeException {
13 |
14 | /**
15 | * Constructs an
4 |
27 | Non-Ordered objects are treated as greatest order values,
10 | * thus ending up at the end of the list, in arbitrary order
11 | * (just like same order values of Ordered objects).
12 | *
13 | * @author Juergen Hoeller
14 | * @since 07.04.2003
15 | * @see Ordered
16 | */
17 | public class OrderComparator implements Comparator {
18 |
19 | public int compare(Object o1, Object o2) {
20 | int i1 = (o1 instanceof Ordered ? ((Ordered) o1).getOrder() : Integer.MAX_VALUE);
21 | int i2 = (o2 instanceof Ordered ? ((Ordered) o2).getOrder() : Integer.MAX_VALUE);
22 |
23 | // direct evaluation instead of Integer.compareTo to avoid unnecessary object creation
24 | if (i1 < i2)
25 | return -1;
26 | else if (i1 > i2)
27 | return 1;
28 | else
29 | return 0;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/com/interface21/ejb/support/AbstractStatefulSessionBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The Spring Framework is published under the terms
3 | * of the Apache Software License.
4 | */
5 |
6 | package com.interface21.ejb.support;
7 |
8 | import javax.ejb.CreateException;
9 |
10 | /**
11 | * Convenient superclass for stateful session beans.
12 | * SFSBs should extend this class, leaving them to implement
13 | * the ejbActivate() and ejbPassivate() lifecycle methods
14 | * to comply with the requirements of the EJB specification.
15 | *
16 | * NB: Subclasses should invoke the loadBeanFactory()
17 | * method in their custom ejbCreate() methods.
18 | *
19 | * @version $Id$
20 | * @author Rod Johnson
21 | */
22 | public abstract class AbstractStatefulSessionBean extends AbstractSessionBean {
23 |
24 | /**
25 | * Load a Spring BeanFactory namespace. Exposed for subclasses
26 | * to load a BeanFactory in their ejbCreate() methods.
27 | */
28 | protected void loadBeanFactory() throws CreateException {
29 | super.loadBeanFactory();
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/com/interface21/jdbc/core/SQLWarningException.java:
--------------------------------------------------------------------------------
1 |
2 | package com.interface21.jdbc.core;
3 |
4 | import java.sql.SQLWarning;
5 |
6 | import com.interface21.dao.UncategorizedDataAccessException;
7 |
8 | /**
9 | * Exception thrown when we're not ignoring warnings.
10 | * If such an exception is thrown, the operation completed,
11 | * so we will need to explicitly roll it back if we're not happy
12 | * on looking at the warning. We might choose to ignore (or merely log)
13 | * the warning and throw the exception away.
14 | * @author Rod Johnson
15 | */
16 | public class SQLWarningException extends UncategorizedDataAccessException {
17 |
18 | /**
19 | * Constructor for ConnectionFactoryException.
20 | * @param s message
21 | * @param ex JDBC warning
22 | */
23 | public SQLWarningException(String mesg, SQLWarning ex) {
24 | super(mesg, ex);
25 | }
26 |
27 | /**
28 | * Return the SQLWarning.
29 | * @return the SQLWarning
30 | */
31 | public SQLWarning SQLWarning() {
32 | return (SQLWarning) getRootCause();
33 | }
34 |
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/com/interface21/jdbc/datasource/CannotGetJdbcConnectionException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Generic framework code included with
3 | * Expert One-On-One J2EE Design and Development
4 | * by Rod Johnson (Wrox, 2002).
5 | * This code is free to use and modify.
6 | * Please contact rod.johnson@interface21.com
7 | * for commercial support.
8 | */
9 |
10 | package com.interface21.jdbc.datasource;
11 |
12 | import com.interface21.dao.DataAccessResourceFailureException;
13 |
14 | /**
15 | * Fatal exception thrown when we can't connect to an RDBMS
16 | * using JDBC.
17 | * @author Rod Johnson
18 | */
19 | public class CannotGetJdbcConnectionException extends DataAccessResourceFailureException {
20 |
21 | /**
22 | * Constructor for CannotGetJdbcConnectionException.
23 | * @param s message
24 | * @param ex root cause
25 | */
26 | public CannotGetJdbcConnectionException(String s, Throwable ex) {
27 | super(s, ex);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/com/interface21/dao/DataAccessResourceFailureException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Generic framework code included with
3 | * Expert One-On-One J2EE Design and Development
4 | * by Rod Johnson (Wrox, 2002).
5 | * This code is free to use and modify.
6 | * Please contact rod.johnson@interface21.com
7 | * for commercial support.
8 | */
9 |
10 | package com.interface21.dao;
11 |
12 | /**
13 | * Data access exception thrown when a resource fails
14 | * completely: for example, if we can't connect to a database
15 | * using JDBC.
16 | * @author Rod Johnson
17 | * @version $Id$
18 | */
19 | public class DataAccessResourceFailureException extends DataAccessException {
20 |
21 | /**
22 | * Constructor for ResourceFailureDataAccessException.
23 | * @param msg message
24 | * @param ex root cause from data access API in use
25 | */
26 | public DataAccessResourceFailureException(String msg, Throwable ex) {
27 | super(msg, ex);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/com/interface21/beans/factory/NoSuchBeanDefinitionException.java:
--------------------------------------------------------------------------------
1 | package com.interface21.beans.factory;
2 |
3 | import com.interface21.beans.BeansException;
4 |
5 | /**
6 | * Exception thrown when a BeanFactory is asked for a bean
7 | * instance name for which it cannot find a definition.
8 | * @author Rod Johnson
9 | * @version $Id$
10 | */
11 | public class NoSuchBeanDefinitionException extends BeansException {
12 |
13 | /** Name of the missing bean */
14 | private final String name;
15 |
16 | /**
17 | * Creates new Part of the general strategy to allow for using Hibernate within
13 | * application service implementations that just feature DataAccessException
14 | * in their interfaces. Clients of these services do not need to be aware of
15 | * the particular data access strategy used by the service implementations.
16 | *
17 | * @author Juergen Hoeller
18 | * @since 02.05.2003
19 | * @see HibernateTemplate
20 | * @see com.interface21.dao
21 | */
22 | public class HibernateSystemException extends UncategorizedDataAccessException {
23 |
24 | public HibernateSystemException(String msg, HibernateException ex) {
25 | super(msg, ex);
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/test/com/interface21/jndi/JndiObjectFactoryBeanTests.java:
--------------------------------------------------------------------------------
1 |
2 | package com.interface21.jndi;
3 |
4 | import com.interface21.jndi.support.ExpectedLookupTemplate;
5 |
6 | import junit.framework.TestCase;
7 |
8 | /**
9 | * @author Rod Johnson
10 | */
11 | public class JndiObjectFactoryBeanTests extends TestCase {
12 |
13 | /**
14 | * Constructor for JndiObjectFactoryBeanTests.
15 | * @param arg0
16 | */
17 | public JndiObjectFactoryBeanTests(String arg0) {
18 | super(arg0);
19 | }
20 |
21 |
22 | public void testNoJndiName() {
23 | JndiObjectFactoryBean jof = new JndiObjectFactoryBean();
24 | try {
25 | jof.afterPropertiesSet();
26 | fail();
27 | }
28 | catch (Exception ex) {
29 |
30 | }
31 | }
32 |
33 |
34 | public void testLookupReturns() throws Exception {
35 | JndiObjectFactoryBean jof = new JndiObjectFactoryBean();
36 | Object o = new Object();
37 | jof.setJndiTemplate(new ExpectedLookupTemplate("java:comp/env/foo", o));
38 | jof.setJndiName("foo");
39 | jof.afterPropertiesSet();
40 | assertTrue(jof.getObject() == o);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/com/interface21/context/MessageSourceResolvable.java:
--------------------------------------------------------------------------------
1 | package com.interface21.context;
2 |
3 | /**
4 | * Interface for objects that are suitable for message resolution,
5 | * e.g. validation errors.
6 | *
7 | * 适用于消息解析的对象的接口,例如验证错误。
8 | *
9 | * @author Tony Falabella
10 | * @see MessageSource#getMessage
11 | */
12 | public interface MessageSourceResolvable {
13 |
14 | /**
15 | * Return the codes to be used to resolve this message,
16 | * in the order they should get tried. The last code will
17 | * therefore be the default one.
18 | * @return a String code associated with this message
19 | */
20 | public String[] getCodes();
21 |
22 | /**
23 | * Return the array of args to be used to resolve this message.
24 | * @return An array of objects to be used as params to replace
25 | * placeholders within the code message text.
26 | */
27 | public Object[] getArgs();
28 |
29 | /**
30 | * Return the defaultMessage to be used to resolve this message.
31 | * @return The defaultMessage, or null if no default.
32 | */
33 | public String getDefaultMessage();
34 | }
35 |
--------------------------------------------------------------------------------
/src/com/interface21/transaction/interceptor/DefaultTransactionAttribute.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The Spring Framework is published under the terms
3 | * of the Apache Software License.
4 | */
5 |
6 | package com.interface21.transaction.interceptor;
7 |
8 | import com.interface21.transaction.support.DefaultTransactionDefinition;
9 |
10 | /**
11 | * Transaction attribute that takes EJB approach to rolling
12 | * back on runtime, but not checked, exceptions.
13 | * @author Rod Johnson
14 | * @since 16-Mar-2003
15 | * @version $Id$
16 | */
17 | public class DefaultTransactionAttribute extends DefaultTransactionDefinition
18 | implements TransactionAttribute {
19 |
20 | public DefaultTransactionAttribute() {
21 | }
22 |
23 | public DefaultTransactionAttribute(int propagationBehavior) {
24 | super(propagationBehavior);
25 | }
26 |
27 | /**
28 | * Default behaviour is as with EJB: rollback on unchecked exception.
29 | * Consistent with TransactionTemplate's behavior.
30 | */
31 | public boolean rollbackOn(Throwable t) {
32 | return (t instanceof RuntimeException);
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/src/com/interface21/web/context/ContextLoaderListener.java:
--------------------------------------------------------------------------------
1 | package com.interface21.web.context;
2 |
3 | import javax.servlet.ServletContextEvent;
4 | import javax.servlet.ServletContextListener;
5 |
6 | /**
7 | * Bootstrap listener to start up Spring's root WebApplicationContext.
8 | * Simply delegates to ContextLoader.
9 | *
10 | * Note: This listener should be registered after Log4jConfigListener,
11 | * if the latter is used.
12 | *
13 | * @author Juergen Hoeller
14 | * @since 17.02.2003
15 | * @see ContextLoader
16 | * @see com.interface21.web.util.Log4jConfigListener
17 | */
18 | public class ContextLoaderListener implements ServletContextListener {
19 |
20 | /**
21 | * Initialize the root web application context.
22 | */
23 | public void contextInitialized(ServletContextEvent event) {
24 | ContextLoader.initContext(event.getServletContext());
25 | }
26 |
27 | /**
28 | * Close the root web application context.
29 | */
30 | public void contextDestroyed(ServletContextEvent event) {
31 | ContextLoader.closeContext(event.getServletContext());
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/com/interface21/aop/interceptor/DebugInterceptor.java:
--------------------------------------------------------------------------------
1 |
2 | package com.interface21.aop.interceptor;
3 |
4 | import org.aopalliance.intercept.MethodInterceptor;
5 | import org.aopalliance.intercept.MethodInvocation;
6 |
7 | /**
8 | * Trivial interceptor that can be introduced in a chain to display it.
9 | *
10 | * (c) Rod Johnson, 2003
11 | * @author Rod Johnson
12 | */
13 | public class DebugInterceptor implements MethodInterceptor {
14 |
15 | // TODO learning interceptor?
16 | // AI? learns usage pattern?
17 | // code metrics
18 | // param values, etc?
19 |
20 | private int count;
21 |
22 | /**
23 | * @see org.aopalliance.intercept.MethodInterceptor#invoke(MethodInvocation)
24 | */
25 | public Object invoke(MethodInvocation invocation) throws Throwable {
26 | ++count;
27 | System.out.println("Debug interceptor: count=" + count +
28 | " invocation=[" + invocation + "]");
29 | Object rval = invocation.proceed();
30 | System.out.println("Debug interceptor: next returned");
31 | return rval;
32 | }
33 |
34 | public int getCount() {
35 | return this.count;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/com/interface21/ejb/support/package.html:
--------------------------------------------------------------------------------
1 |
Note that the default behaviour is to look for an EJB enviroment variable
with name DataSourceTransactionManager binds instances of this class
10 | * to the thread, for a given DataSource.
11 | *
12 | * Note: This is an SPI class, not intended to be used by applications.
13 | *
14 | * @author Juergen Hoeller
15 | * @since 06.05.2003
16 | * @see DataSourceTransactionManager
17 | * @see DataSourceTransactionObject
18 | * @see DataSourceUtils
19 | */
20 | public class ConnectionHolder {
21 |
22 | private final Connection connection;
23 |
24 | private boolean rollbackOnly;
25 |
26 | public ConnectionHolder(Connection connection) {
27 | this.connection = connection;
28 | }
29 |
30 | public Connection getConnection() {
31 | return connection;
32 | }
33 |
34 | public void setRollbackOnly() {
35 | this.rollbackOnly = true;
36 | }
37 |
38 | public boolean isRollbackOnly() {
39 | return rollbackOnly;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/src/com/interface21/remoting/rmi/RemoteInvocationWrapper.java:
--------------------------------------------------------------------------------
1 | package com.interface21.remoting.rmi;
2 |
3 | import java.lang.reflect.Method;
4 | import java.rmi.RemoteException;
5 | import java.rmi.server.UnicastRemoteObject;
6 |
7 | /**
8 | * Server-side implementation of RemoteInvocationHandler.
9 | * An instance of this class exists for each remote object.
10 | *
11 | * @author Juergen Hoeller
12 | * @since 14.05.2003
13 | */
14 | class RemoteInvocationWrapper extends UnicastRemoteObject implements RemoteInvocationHandler {
15 |
16 | private Object wrappedObject;
17 |
18 | /**
19 | * Create a new RemoteInvocationWrapper.
20 | * @param wrappedObject the locally wrapped object, on which methods are invoked
21 | */
22 | public RemoteInvocationWrapper(Object wrappedObject) throws RemoteException {
23 | super();
24 | this.wrappedObject = wrappedObject;
25 | }
26 |
27 | public Object invokeRemote(String methodName, Class[] paramTypes, Object[] params) throws Exception {
28 | Method method = wrappedObject.getClass().getMethod(methodName, paramTypes);
29 | return method.invoke(wrappedObject, params);
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
20 | ">Home
21 |
--------------------------------------------------------------------------------
/src/com/interface21/transaction/InvalidTimeoutException.java:
--------------------------------------------------------------------------------
1 | package com.interface21.transaction;
2 |
3 | /**
4 | * Exception that gets thrown when an invalid timeout is specified,
5 | * i.e. the transaction manager implementation doesn't support timeouts.
6 | * @author Juergen Hoeller
7 | * @since 12.05.2003
8 | */
9 | public class InvalidTimeoutException extends TransactionUsageException {
10 |
11 | private int timeout = TransactionDefinition.TIMEOUT_DEFAULT;
12 |
13 | public InvalidTimeoutException(String msg, int timeout) {
14 | super(msg);
15 | this.timeout = timeout;
16 | }
17 |
18 | public int getTimeout() {
19 | return timeout;
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/com/interface21/transaction/interceptor/NoRollbackRuleAttribute.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The Spring Framework is published under the terms
3 | * of the Apache Software License.
4 | */
5 |
6 | package com.interface21.transaction.interceptor;
7 |
8 | /**
9 | * Tag class. Its class means it has the opposite
10 | * behaviour to the RollbackRule superclass.
11 | * @author Rod Johnson
12 | * @since 09-Apr-2003
13 | * @version $Revision$
14 | */
15 | public class NoRollbackRuleAttribute extends RollbackRuleAttribute {
16 |
17 | /**
18 | * @param exceptionName
19 | */
20 | public NoRollbackRuleAttribute(String exceptionName) {
21 | super(exceptionName);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/com/interface21/aop/interceptor/AbstractQaInterceptor.java:
--------------------------------------------------------------------------------
1 | package com.interface21.aop.interceptor;
2 |
3 | import org.aopalliance.intercept.MethodInterceptor;
4 | import org.aopalliance.intercept.MethodInvocation;
5 |
6 | public abstract class AbstractQaInterceptor implements MethodInterceptor {
7 |
8 | /**
9 | * @see org.aopalliance.intercept.MethodInterceptor#invoke(MethodInvocation)
10 | */
11 | public Object invokeInternal(MethodInvocation invocation) throws Throwable {
12 | Object result = invocation.proceed();
13 | checkInvariants(invocation.getThis());
14 | return result;
15 | }
16 |
17 | protected abstract void checkInvariants(Object target);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/src/com/interface21/beans/NotWritablePropertyException.java:
--------------------------------------------------------------------------------
1 |
2 | package com.interface21.beans;
3 |
4 | /**
5 | * Exception thrown on an attempt to set the value of
6 | * a property that isn't writable, because there's no
7 | * setter method.
8 | * @author Rod Johnson
9 | */
10 | public class NotWritablePropertyException extends BeansException {
11 |
12 | /**
13 | * Creates new NotWritablePropertyException without detail message.
14 | */
15 | public NotWritablePropertyException(String propertyName, Class beanClass) {
16 | super("Property [" + propertyName + "] is not writable in bean class [" + beanClass.getName() + "]");
17 | }
18 | }
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/com/interface21/core/HasRootCause.java:
--------------------------------------------------------------------------------
1 |
2 | package com.interface21.core;
3 |
4 | /**
5 | * Interface to be implemented by exceptions that have
6 | * a root cause.
7 | * This enables exceptions that don't share a common superclass
8 | * to expose a root cause consistently.
9 | * This will no longer be necessary in Java 1.4,
10 | * although it won't be incompatible.
11 | * @author Rod Johnson
12 | * @version $Id$
13 | */
14 | public interface HasRootCause {
15 |
16 | /**
17 | * Return the root cause of this exception
18 | * @return the root cause of this exception,
19 | * or null if there was no root cause
20 | */
21 | Throwable getRootCause();
22 |
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/src/com/interface21/transaction/TransactionException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The Spring Framework is published under the terms
3 | * of the Apache Software License.
4 | */
5 |
6 | package com.interface21.transaction;
7 |
8 | import com.interface21.core.NestedRuntimeException;
9 |
10 | /**
11 | * Superclass for all transaction exceptions.
12 | * @author Rod Johnson
13 | * @since 17-Mar-2003
14 | * @version $Revision$
15 | */
16 | public abstract class TransactionException extends NestedRuntimeException {
17 |
18 | public TransactionException(String msg) {
19 | super(msg);
20 | }
21 |
22 | public TransactionException(String msg, Throwable ex) {
23 | super(msg, ex);
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/test/com/interface21/beans/factory/xml/parent.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Entity that should be in the system but is not.
13 | *
14 | * @author Ken Krebs
15 | */
16 | public class NoSuchEntityException extends NestedRuntimeException {
17 |
18 | /**
19 | * Creates a new instance of NoSuchIdException.
20 | */
21 | public NoSuchEntityException(Entity entity) {
22 | super("No such " + entity.getClass().getName() + " with id " + entity.getId());
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/com/interface21/beans/SortDefinition.java:
--------------------------------------------------------------------------------
1 | package com.interface21.beans;
2 |
3 | /**
4 | * Definition for sorting bean instances by a property.
5 | *
6 | * 用于按属性排序bean实例的定义。
7 | *
8 | * @author Juergen Hoeller
9 | * @since 26.05.2003
10 | */
11 | public interface SortDefinition {
12 |
13 | /**
14 | * Return the name of the property to sort by.
15 | *
16 | * 返回要排序的属性的名称。
17 | *
18 | */
19 | String getProperty();
20 |
21 | /**
22 | * Return whether upper and lower case in String values should be ignored.
23 | */
24 | boolean isIgnoreCase();
25 |
26 | /**
27 | * Return if ascending or descending.
28 | *
29 | * 如果上升或下降则返回。
30 | *
31 | */
32 | boolean isAscending();
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/com/interface21/beans/factory/support/CxsFactory.java:
--------------------------------------------------------------------------------
1 | package com.interface21.beans.factory.support;
2 |
3 | import com.interface21.beans.factory.NoSuchBeanDefinitionException;
4 |
5 | /**
6 | *
7 | *
8 | * @author 玄灭
9 | * @date 2018/10/7-下午7:32
10 | */
11 | public class CxsFactory extends AbstractBeanFactory {
12 |
13 | protected AbstractBeanDefinition getBeanDefinition(String beanName)
14 | throws NoSuchBeanDefinitionException {
15 | AbstractBeanDefinition bd = null;
16 | // (AbstractBeanDefinition) beanDefinitionMap.get(beanName);
17 | if (bd == null)
18 | throw new NoSuchBeanDefinitionException(beanName, toString());
19 | return bd;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/samples/petclinic/test/src/petclinic/OwnerTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * OwnerTest.java
3 | *
4 | */
5 |
6 | package petclinic;
7 |
8 | import junit.framework.*;
9 |
10 | /**
11 | * JUnit test for Owner
12 | *
13 | * @author Ken Krebs
14 | */
15 | public class OwnerTest extends TestCase {
16 |
17 | /** Test of hasPet method, of class Owner. */
18 | public void testHasPet() {
19 | System.out.println("testHasPet");
20 |
21 | Owner owner = new Owner();
22 | Pet fido = new Pet();
23 | fido.setName("Fido");
24 | assertFalse(owner.hasPet("Fido"));
25 | assertFalse(owner.hasPet("fido"));
26 | owner.addPet(fido);
27 | assertTrue(owner.hasPet("Fido"));
28 | assertTrue(owner.hasPet("fido"));
29 | }
30 |
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/com/interface21/transaction/CannotCreateTransactionException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The Spring Framework is published under the terms
3 | * of the Apache Software License.
4 | */
5 |
6 | package com.interface21.transaction;
7 |
8 | /**
9 | * Exception thrown when a transaction can't be created using an
10 | * underlying transaction API such as JTA.
11 | * @author Rod Johnson
12 | * @since 17-Mar-2003
13 | * @version $Revision$
14 | */
15 | public class CannotCreateTransactionException extends TransactionException {
16 |
17 | public CannotCreateTransactionException(String msg) {
18 | super(msg);
19 | }
20 |
21 | public CannotCreateTransactionException(String msg, Throwable ex) {
22 | super(msg, ex);
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/test/com/interface21/web/servlet/view/views.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BeanDefinitionStoreException with the specified detail message.
16 | * @param msg the detail message.
17 | * @param t the root cause of the problem with the factory.
18 | */
19 | public BeanDefinitionStoreException(String msg,Throwable t) {
20 | super(msg, t);
21 | }
22 | }
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/com/interface21/beans/factory/BeanIsNotAFactoryException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The Spring Framework is published under the terms
3 | * of the Apache Software License.
4 | */
5 |
6 | package com.interface21.beans.factory;
7 |
8 | /**
9 | * Exception thrown when a bean is not a factory,
10 | * but a user tries to get at the factory for the given bean name.
11 | * Whether a bean is a factory is determined by whether it implements
12 | * the FactoryBean interface.
13 | * @author Rod Johnson
14 | * @since 10-Mar-2003
15 | * @see com.interface21.beans.factory.FactoryBean
16 | * @version $Revision$
17 | */
18 | public class BeanIsNotAFactoryException extends BeanNotOfRequiredTypeException {
19 |
20 | public BeanIsNotAFactoryException(String name, Object actualInstance) {
21 | super(name, FactoryBean.class, actualInstance);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/com/interface21/beans/factory/DisposableBean.java:
--------------------------------------------------------------------------------
1 | package com.interface21.beans.factory;
2 |
3 | /**
4 | * Interface to be implemented by beans that want to release resources
5 | * on destruction. A BeanFactory is supposed to invoke the destroy
6 | * method if it disposes a cached singleton. An application context
7 | * is supposed to dispose all of its singletons on close.
8 | * @author Juergen Hoeller
9 | * @since 12.08.2003
10 | * @see com.interface21.context.ApplicationContext#close
11 | */
12 | public interface DisposableBean {
13 |
14 | /**
15 | * Invoked by a BeanFactory on destruction of a singleton.
16 | * @throws Exception in case of shutdown errors.
17 | * Exceptions will get logged but not rethrown to allow
18 | * other beans to release their resources too.
19 | */
20 | void destroy() throws Exception;
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/com/interface21/context/package.html:
--------------------------------------------------------------------------------
1 |
2 | FatalBeanException
13 | * with the specified message.
14 | * @param msg the detail message.
15 | */
16 | public FatalBeanException(String msg) {
17 | super(msg);
18 | }
19 |
20 | /**
21 | * Constructs a FatalBeanException
22 | * with the specified message and root cause.
23 | * @param msg the detail message.
24 | * @param t root cause
25 | */
26 | public FatalBeanException(String msg, Throwable t) {
27 | super(msg, t);
28 | }
29 | }
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/com/interface21/beans/propertyeditors/ClassEditor.java:
--------------------------------------------------------------------------------
1 | package com.interface21.beans.propertyeditors;
2 |
3 | import java.beans.PropertyEditorSupport;
4 |
5 | /**
6 | * Editor for java.lang.Class, to directly feed a Class property
7 | * instead of needing an additional class name property.
8 | * @author Juergen Hoeller
9 | * @since 13.05.2003
10 | */
11 | public class ClassEditor extends PropertyEditorSupport {
12 |
13 | public void setAsText(String text) throws IllegalArgumentException {
14 | Class clazz = null;
15 | try {
16 | clazz = Class.forName(text);
17 | }
18 | catch (ClassNotFoundException ex) {
19 | throw new IllegalArgumentException("Invalid class name [" + text + "]: " + ex.getMessage());
20 | }
21 | setValue(clazz);
22 | }
23 |
24 | public String getAsText() {
25 | return ((Class) getValue()).getName();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/com/interface21/context/ApplicationContextException.java:
--------------------------------------------------------------------------------
1 |
2 | package com.interface21.context;
3 |
4 | import com.interface21.core.NestedRuntimeException;
5 |
6 | /**
7 | * Exception thrown during application context initialization.
8 | * @author Rod Johnson
9 | */
10 | public class ApplicationContextException extends NestedRuntimeException {
11 |
12 | /**
13 | * Constructs an ApplicationContextException
14 | * with the specified detail message and no root cause.
15 | * @param msg the detail message.
16 | */
17 | public ApplicationContextException(String msg) {
18 | super(msg);
19 | }
20 |
21 | /**
22 | * @see NestedRuntimeException#NestedRuntimeException(String, Throwable)
23 | */
24 | public ApplicationContextException(String msg, Throwable t) {
25 | super(msg, t);
26 | }
27 | }
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/com/interface21/ui/context/Theme.java:
--------------------------------------------------------------------------------
1 | package com.interface21.ui.context;
2 |
3 | import com.interface21.context.MessageSource;
4 |
5 | /**
6 | * A Theme can resolve theme-specific messages, codes, file paths, etc
7 | * (e.g. CSS and image files in a web environment).
8 | * The MessageSource supports parameterization and internationalization.
9 | * @author Juergen Hoeller
10 | * @since 17.06.2003
11 | * @see ThemeSource
12 | * @see com.interface21.web.servlet.theme
13 | */
14 | public interface Theme {
15 |
16 | /**
17 | * Return the name of the theme.
18 | * @return the name of the theme
19 | */
20 | String getName();
21 |
22 | /**
23 | * Return the specific MessageSource that resolves messages
24 | * with respect to this theme.
25 | * @return the theme-specific MessageSource
26 | */
27 | MessageSource getMessageSource();
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/samples/countries/src/com/interface21/samples/countries/dao/DaoCountryJdbcMySql.java:
--------------------------------------------------------------------------------
1 | package com.interface21.samples.countries.dao;
2 |
3 | /**
4 | * MySql Subclass for CountryDaoJdbC.
5 | *
6 | * @author Jean-Pierre Pawlak
7 | */
8 | public class DaoCountryJdbcMySql extends DaoCountryJdbc {
9 |
10 | // MySql specific examples
11 | protected String DROP_SQL = "DROP TABLE IF EXISTS countries";
12 | protected String CREATE_SQL = "CREATE TABLE countries (lang CHAR(2), code CHAR(2), name VARCHAR(50), PRIMARY KEY (lang,code) ) Type InnoDB";
13 | // We don't include indexes due to the small size of this table.
14 |
15 | /**
16 | * @see com.interface21.samples.countries.dao.IDaoCountry#initBase()
17 | */
18 | public void initBase() {
19 | this.setDropSql(DROP_SQL);
20 | this.setCreateSql(CREATE_SQL);
21 | super.initBase();
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/com/interface21/beans/PropertyAccessException.java:
--------------------------------------------------------------------------------
1 |
2 | package com.interface21.beans;
3 |
4 | import java.beans.PropertyChangeEvent;
5 |
6 | /**
7 | * Superclass for exceptions related to a property access,
8 | * such as type mismatch or invocation target exception.
9 | * @author Rod Johnson
10 | * @version $Revision$
11 | */
12 | public abstract class PropertyAccessException extends BeansException {
13 |
14 | private PropertyChangeEvent propertyChangeEvent;
15 |
16 | public PropertyAccessException(String mesg, PropertyChangeEvent propertyChangeEvent, Throwable t) {
17 | super(mesg, t);
18 | this.propertyChangeEvent = propertyChangeEvent;
19 | }
20 |
21 | /**
22 | * @return the PropertyChangeEvent that resulted in the problem
23 | */
24 | public PropertyChangeEvent getPropertyChangeEvent() {
25 | return propertyChangeEvent;
26 | }
27 |
28 | }
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/com/interface21/beans/factory/support/RuntimeBeanReference.java:
--------------------------------------------------------------------------------
1 | package com.interface21.beans.factory.support;
2 |
3 | /**
4 | * Immutable placeholder class used for the value of a PropertyValue
5 | * object when it's a reference to another bean in this
6 | * factory to be resolved at runtime.
7 | *
8 | * 用于PropertyValue值的不可变占位符类 对象,当它是对此中另一个bean的引用时工厂在运行时解决。
9 | * @author Rod Johnson
10 | */
11 | public class RuntimeBeanReference {
12 |
13 | private final String beanName;
14 |
15 | /**
16 | * Create a new RuntimeBeanReference to the given bean nam.
17 | * @param beanName name of the target bean.
18 | */
19 | public RuntimeBeanReference(String beanName) {
20 | this.beanName = beanName;
21 | }
22 |
23 | /**
24 | * Return the target bean name.
25 | * @return the target bean name.
26 | */
27 | public String getBeanName() {
28 | return beanName;
29 | }
30 | }
--------------------------------------------------------------------------------
/src/com/interface21/beans/propertyeditors/StringArrayPropertyEditor.java:
--------------------------------------------------------------------------------
1 | package com.interface21.beans.propertyeditors;
2 |
3 | import java.beans.PropertyEditorSupport;
4 |
5 | import com.interface21.util.StringUtils;
6 |
7 | /**
8 | * Properties editor for String[] type. Strings must be in CSV format.
9 | * This property editor is automatically registered by BeanWrapperImpl.
10 | * @author Rod Johnson
11 | * @see com.interface21.beans.BeanWrapperImpl
12 | */
13 | public class StringArrayPropertyEditor extends PropertyEditorSupport {
14 |
15 | public void setAsText(String s) throws IllegalArgumentException {
16 | String[] sa = StringUtils.commaDelimitedListToStringArray(s);
17 | setValue(sa);
18 | }
19 |
20 | public String getAsText() {
21 | String[] array = (String[]) this.getValue();
22 | return StringUtils.arrayToCommaDelimitedString(array);
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/com/interface21/jdbc/core/package.html:
--------------------------------------------------------------------------------
1 |
Validator for FindOwnerForm.
15 | *
16 | * @author Ken Krebs
17 | */
18 | public class FindOwnersValidator implements Validator {
19 |
20 | public boolean supports(Class clazz) {
21 | return clazz.equals(Owner.class);
22 | }
23 |
24 | public void validate(Object obj, Errors errors) {
25 | Owner owner = (Owner) obj;
26 | String lastName = owner.getLastName();
27 | if(lastName == null || "".equals(lastName)) {
28 | errors.rejectValue("lastName", "required", null, "required");
29 | }
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/com/interface21/web/servlet/handler/UrlAwareHandler.java:
--------------------------------------------------------------------------------
1 | package com.interface21.web.servlet.handler;
2 |
3 | /**
4 | * Optional interface to be implemented by request handlers in our
5 | * MVC approach that are interested in the URL they are mapped to.
6 | * @author Rod Johnson
7 | */
8 | public interface UrlAwareHandler {
9 |
10 | /**
11 | * Set the URL this handler is mapped to.
12 | * This interface will only be implemented by some handlers:
13 | * others may be mapped to many URLs, and so cannot
14 | * benefit from knowledge of individual mappings.
15 | * Of course a handler can find out the request URL when it handles
16 | * a request: implementations of this interface want to know
17 | * about a single URL mapping before they begin to handle
18 | * requests.
19 | * @param url the URL this handler is mapped to
20 | */
21 | void setUrlMapping(String url);
22 |
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/samples/skeletons/readme.txt:
--------------------------------------------------------------------------------
1 | -- Spring application skeletons --
2 | @author Juergen Hoeller
3 |
4 | This directory contains application skeletons for various scenarios,
5 | each in its own subdirectory. Those are not executable apps but just
6 | intended as configuration showcases that can serve as starting point
7 | for custom projects. All config files are extensively documented.
8 |
9 | For further details on the mentioned framework classes, consult the
10 | Spring Javadocs in the /docs/api directory. The class descriptions
11 | do not only present the respective features, they also give usage
12 | hints and illustrate general best practices.
13 |
14 | Note that the sample application classes in the "example" package
15 | that are mentioned in the config files are not included, as those
16 | definitions just serve as configuration blueprints. Some hints
17 | on how they might be implemented are given in the comments.
18 |
--------------------------------------------------------------------------------
/samples/petclinic/src/petclinic/validation/VisitValidator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * VisitValidator.java
3 | *
4 | */
5 |
6 | package petclinic.validation;
7 |
8 | import petclinic.Visit;
9 |
10 | import com.interface21.validation.Errors;
11 | import com.interface21.validation.Validator;
12 |
13 | /**
14 | * JavaBean Validator for Visit Forms.
15 | *
16 | * @author Ken Krebs
17 | */
18 | public class VisitValidator implements Validator {
19 |
20 | public boolean supports(Class clazz) {
21 | return clazz.equals(Visit.class);
22 | }
23 |
24 | public void validate(Object obj, Errors errors) {
25 | Visit visit = (Visit) obj;
26 | String description = visit.getDescription();
27 | if(description == null || "".equals(description)) {
28 | errors.rejectValue("description", "required", null, "required");
29 | }
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/samples/skeletons/webapp-hibernate/WEB-INF/classes/example.hbm.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 | Validator for Pet Forms.
15 | *
16 | * @author Ken Krebs
17 | */
18 | public class PetValidator implements Validator {
19 |
20 | public boolean supports(Class clazz) {
21 | return clazz.equals(Pet.class);
22 | }
23 |
24 | public void validate(Object obj, Errors errors) {
25 | Pet pet = (Pet) obj;
26 | String name = pet.getName();
27 | if (name == null || "".equals(name)) {
28 | errors.rejectValue("name", "required", null, "required");
29 | }
30 | if (pet.getId() == 0 && pet.getOwner().hasPet(name)) {
31 | errors.rejectValue("name", "duplicate", null, "already exists");
32 | }
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/samples/petclinic/war/WEB-INF/jsp/ownerForm.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="/WEB-INF/jsp/includes.jsp" %>
2 |
3 |
5 |
26 | ">Home
27 |
--------------------------------------------------------------------------------
/samples/countries/war/WEB-INF/views/jsp/countries/model.jsp:
--------------------------------------------------------------------------------
1 |
2 | <%@ include file="../common/includes.jsp" %>
3 |
4 |
5 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/samples/petclinic/src/petclinic/jdbc/HsqlClinic.java:
--------------------------------------------------------------------------------
1 | /*
2 | * HsqlClinic.java
3 | *
4 | */
5 |
6 | package petclinic.jdbc;
7 |
8 | import com.interface21.jdbc.core.support.HsqlMaxValueIncrementer;
9 |
10 | /**
11 | * JavaBean Clinic Hsql implementation
12 | *
13 | * @author Ken Krebs
14 | */
15 | public class HsqlClinic extends AbstractJdbcClinic {
16 |
17 | /** Method sets up Insert operations with Hsql key generators */
18 | protected void setupRdbmsOperations() {
19 | OwnerInsert ownerInsert = new OwnerInsert(new HsqlMaxValueIncrementer(getDataSource(), "owners_seq", "seq"));
20 | setOwnerInsert(ownerInsert);
21 |
22 | PetInsert petInsert = new PetInsert(new HsqlMaxValueIncrementer(getDataSource(), "pets_seq", "seq"));
23 | setPetInsert(petInsert);
24 |
25 | VisitInsert visitInsert = new VisitInsert(new HsqlMaxValueIncrementer(getDataSource(), "visits_seq", "seq"));
26 | setVisitInsert(visitInsert);
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/src/com/interface21/transaction/interceptor/TransactionAttribute.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The Spring Framework is published under the terms
3 | * of the Apache Software License.
4 | */
5 |
6 | package com.interface21.transaction.interceptor;
7 |
8 | import com.interface21.transaction.TransactionDefinition;
9 |
10 | /**
11 | * This interface adds a rollBackOn specification to TransactionDefinition.
12 | * As custom rollBackOn is only possible with AOP, this class resides
13 | * in the AOP transaction package.
14 | *
15 | * @author Rod Johnson
16 | * @since 16-Mar-2003
17 | * @version $Revision$
18 | * @see com.interface21.transaction.interceptor.DefaultTransactionAttribute
19 | */
20 | public interface TransactionAttribute extends TransactionDefinition {
21 |
22 | /**
23 | * Should we roll back on a checked exception?
24 | * @param ex the exception to evaluate
25 | * @return boolean rollback or not
26 | */
27 | boolean rollbackOn(Throwable ex);
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/test/com/interface21/web/servlet/view/testviews.properties:
--------------------------------------------------------------------------------
1 |
2 |
3 | # Format is
4 | # viewName=Clinic Mysql implementation
12 | *
13 | * @author Ken Krebs
14 | */
15 | public class MysqlClinic extends AbstractJdbcClinic {
16 |
17 | /** Method sets up Insert operations with Mysql key generators */
18 | protected void setupRdbmsOperations() {
19 | OwnerInsert ownerInsert = new OwnerInsert(new MySQLMaxValueIncrementer(getDataSource(), "owners_seq", "seq"));
20 | setOwnerInsert(ownerInsert);
21 |
22 | PetInsert petInsert = new PetInsert(new MySQLMaxValueIncrementer(getDataSource(), "pets_seq", "seq"));
23 | setPetInsert(petInsert);
24 |
25 | VisitInsert visitInsert = new VisitInsert(new MySQLMaxValueIncrementer(getDataSource(), "visits_seq", "seq"));
26 | setVisitInsert(visitInsert);
27 | }
28 |
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/test/com/interface21/aop/framework/TimestampIntroductionInterceptor.java:
--------------------------------------------------------------------------------
1 | package com.interface21.aop.framework;
2 |
3 |
4 | import com.interface21.aop.framework.DelegatingIntroductionInterceptor;
5 | import com.interface21.core.TimeStamped;
6 |
7 | /**
8 | *
9 | */
10 | public class TimestampIntroductionInterceptor extends DelegatingIntroductionInterceptor
11 | implements TimeStamped {
12 |
13 | private long ts;
14 |
15 |
16 | public TimestampIntroductionInterceptor(long ts) {
17 | this();
18 | this.ts = ts;
19 | }
20 |
21 | public void setTime(long ts) {
22 | this.ts = ts;
23 | }
24 | /**
25 | * Constructor for TestAspectInterface.
26 | * @param interfacesToPublish
27 | */
28 | public TimestampIntroductionInterceptor() {
29 | }
30 |
31 | /**
32 | * @see com.interface21.core.TimeStamped#getTimeStamp()
33 | */
34 | public long getTimeStamp() {
35 | System.out.println("Invoked getTimeStamp method");
36 | return ts;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/test/com/interface21/jdbc/mock/SpringMockDataSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * SpringMockDataSource.java
3 | *
4 | * Copyright (C) 2002 by Interprise Software. All rights reserved.
5 | */
6 | package com.interface21.jdbc.mock;
7 |
8 | import java.sql.Connection;
9 |
10 | import com.interface21.jdbc.datasource.SmartDataSource;
11 | import com.mockobjects.sql.MockDataSource;
12 |
13 | /**
14 | * @task enter type comments
15 | *
16 | * @author Trevor D. Cook
17 | * @version $Id$
18 | */
19 | public class SpringMockDataSource
20 | extends MockDataSource
21 | implements SmartDataSource {
22 |
23 | /**
24 | * Constructor for SpringMockDataSource.
25 | */
26 | public SpringMockDataSource() {
27 | super();
28 | }
29 |
30 | /**
31 | * @see com.interface21.jdbc.datasource.SmartDataSource#shouldClose(java.sql.Connection)
32 | */
33 | public boolean shouldClose(Connection conn) {
34 | return false;
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/test/com/interface21/web/context/WEB-INF/testNamespace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Entity.
35 | * @param entity Properties source
36 | */
37 | public void copyPropertiesFrom(Entity entity) {
38 | setId(entity.getId());
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/src/com/interface21/context/ApplicationEventMulticaster.java:
--------------------------------------------------------------------------------
1 | package com.interface21.context;
2 |
3 | /**
4 | * Subinterface of ApplicationListener to be implemented by
5 | * listeners that can broadcast events to other listeners.
6 | *
7 | * ApplicationListener的子接口由侦听器实现,可以将事件广播到其他侦听器
8 | *
9 | * @author Rod Johnson
10 | */
11 | public interface ApplicationEventMulticaster extends ApplicationListener {
12 |
13 | /**
14 | * Add a listener to be notified of all events
15 | * @param listener listener to add
16 | */
17 | void addApplicationListener(ApplicationListener listener);
18 |
19 | /**
20 | * Remove a listener in the notification list]
21 | * @param listener listener to remove
22 | */
23 | void removeApplicationListener(ApplicationListener listener);
24 |
25 | /**
26 | * Remove all listeners registered with this multicaster.
27 | * It will perform no action on event notification until more
28 | * listeners are registered.
29 | */
30 | void removeAllListeners();
31 |
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/src/com/interface21/context/ApplicationListener.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Generic framework code included with
3 | * Expert One-On-One J2EE Design and Development
4 | * by Rod Johnson (Wrox, 2002).
5 | * This code is free to use and modify.
6 | * Please contact rod.johnson@interface21.com
7 | * for commercial support.
8 | */
9 |
10 |
11 | package com.interface21.context;
12 |
13 | import java.util.EventListener;
14 |
15 | /**
16 | * Interface to be implemented by event listeners.
17 | * Based on standard java.util base class for Observer
18 | * design pattern.
19 | *
20 | * 由事件侦听器实现的接口。 基于Observer 设计模式的标准java.util基类。
21 | *
22 | * @author Rod Johnson
23 | */
24 | public interface ApplicationListener extends EventListener {
25 |
26 | /**
27 | * Handle an application event
28 | * @param e event to respond to
29 | */
30 | void onApplicationEvent(ApplicationEvent e);
31 |
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/src/com/interface21/aop/framework/MethodPointcut.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The Spring Framework is published under the terms
3 | * of the Apache Software License.
4 | */
5 |
6 | package com.interface21.aop.framework;
7 |
8 | import org.aopalliance.intercept.MethodInterceptor;
9 |
10 | /**
11 | * Interface to be implemented by objects that can cause
12 | * conditional invocation of an Interceptor depending on
13 | * the method, arguments and attributes passed.
14 | *
15 | * 是否调用拦截器,取决于条件?
16 | *
17 | * @author Rod Johnson
18 | * @since 03-Apr-2003
19 | * @version $Id$
20 | */
21 | public interface MethodPointcut {
22 |
23 | /**
24 | * Return the interceptor to run conditionally
25 | * 返回拦截器,有条件的运行.
26 | * @return MethodInterceptor
27 | */
28 | MethodInterceptor getInterceptor();
29 |
30 | /**
31 | * Arbitrary int value. Depends on other values.
32 | * Higher values cause interceptors to be invoked earlier
33 | * in the invocation chain.
34 | * @return int
35 | */
36 | //int getPrecedence();
37 | }
38 |
--------------------------------------------------------------------------------
/test/com/interface21/beans/factory/xml/initializers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | BeansException with the specified message
16 | * and root cause.
17 | * @param msg the detail message.
18 | * @param t the root cause
19 | */
20 | public BeansException(String msg, Throwable t) {
21 | super(msg, t);
22 | }
23 |
24 | /**
25 | * Constructs an BeansException with the specified message
26 | * and no root cause.
27 | * @param msg the detail message.
28 | */
29 | public BeansException(String msg) {
30 | super(msg);
31 | }
32 |
33 | }
34 |
35 |
36 |
--------------------------------------------------------------------------------
/src/com/interface21/context/support/MessageSourceResourceBundle.java:
--------------------------------------------------------------------------------
1 | package com.interface21.context.support;
2 |
3 | import java.util.ResourceBundle;
4 | import java.util.Enumeration;
5 | import java.util.Locale;
6 |
7 | import com.interface21.context.MessageSource;
8 | import com.interface21.context.NoSuchMessageException;
9 |
10 | /**
11 | * Allows for accessing a MessageSource as a ResourceBundle.
12 | * @author Juergen Hoeller
13 | * @since 27.02.2003
14 | */
15 | public class MessageSourceResourceBundle extends ResourceBundle {
16 |
17 | private MessageSource source;
18 | private Locale locale;
19 |
20 | public MessageSourceResourceBundle(MessageSource source, Locale locale) {
21 | this.source = source;
22 | this.locale = locale;
23 | }
24 |
25 | protected Object handleGetObject(String code) {
26 | try {
27 | return source.getMessage(code, null, locale);
28 | } catch (NoSuchMessageException e) {
29 | return null;
30 | }
31 | }
32 |
33 | public Enumeration getKeys() {
34 | return null;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/com/interface21/transaction/support/TransactionSynchronization.java:
--------------------------------------------------------------------------------
1 | package com.interface21.transaction.support;
2 |
3 | /**
4 | * Interface for callbacks after transaction completion.
5 | * Supported by AbstractPlatformTransactionManager.
6 | * @author Juergen Hoeller
7 | * @since 02.06.2003
8 | * @see TransactionSynchronizationManager
9 | * @see AbstractPlatformTransactionManager
10 | */
11 | public interface TransactionSynchronization {
12 |
13 | /**
14 | * Completion status in case of proper commit
15 | */
16 | int STATUS_COMMITTED = 0;
17 |
18 | /**
19 | * Completion status in case of proper rollback
20 | */
21 | int STATUS_ROLLED_BACK = 1;
22 |
23 | /**
24 | * Status in case of heuristic mixed completion or system errors
25 | */
26 | int STATUS_UNKNOWN = 2;
27 |
28 | /**
29 | * Invoked after transaction completion.
30 | * Can e.g. perform proper resource cleanup.
31 | * @param status completion status according to the STATUS_ constants
32 | */
33 | void afterCompletion(int status);
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/samples/petclinic/war/WEB-INF/jsp/owners.jsp:
--------------------------------------------------------------------------------
1 | <%@ include file="/WEB-INF/jsp/includes.jsp" %>
2 |
3 | Owners:
5 |
6 |
26 | Name Address City Telephone Pets
7 |
9 |
24 |
10 | ">
11 | "/>
12 |
15 |
16 |
17 |
18 |
19 |
23 |
28 | ">Home
29 |
--------------------------------------------------------------------------------
/src/com/interface21/dao/TypeMismatchDataAccessException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Generic framework code included with
3 | * Expert One-On-One J2EE Design and Development
4 | * by Rod Johnson (Wrox, 2002).
5 | * This code is free to use and modify.
6 | * Please contact rod.johnson@interface21.com
7 | * for commercial support.
8 | */
9 |
10 | package com.interface21.dao;
11 |
12 | /**
13 | * Exception thrown on mismatch between Java type and database type:
14 | * for example on an attempt to set an object of the wrong type
15 | * in an RDBMS column.
16 | * @author Rod Johnson
17 | * @version $Id$
18 | */
19 | public class TypeMismatchDataAccessException extends DataAccessException {
20 |
21 | /**
22 | * Constructor for TypeMismatchDataAccessException.
23 | * @param msg mesg
24 | * @param ex root cause
25 | */
26 | public TypeMismatchDataAccessException(String msg, Throwable ex) {
27 | super(msg, ex);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/com/interface21/core/OrderComparator.java:
--------------------------------------------------------------------------------
1 | package com.interface21.core;
2 |
3 | import java.util.Comparator;
4 |
5 | /**
6 | * Comparator implementation for Ordered objects,
7 | * sorting by order value ascending (resp. by priority descending).
8 | *
9 | * NoSuchBeanDefinitionException..
18 | * @param name the name of the missing bean
19 | * @param message further, detailed message describing the problem.
20 | */
21 | public NoSuchBeanDefinitionException(String name, String message) {
22 | super("No bean named [" + name + "] is defined {" + message + "}", null);
23 | this.name = name;
24 | }
25 |
26 | /**
27 | * Return the name of the missing bean.
28 | * @return the name of the missing bean
29 | */
30 | public String getBeanName() {
31 | return name;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/com/interface21/orm/hibernate/HibernateSystemException.java:
--------------------------------------------------------------------------------
1 | package com.interface21.orm.hibernate;
2 |
3 | import net.sf.hibernate.HibernateException;
4 |
5 | import com.interface21.dao.UncategorizedDataAccessException;
6 |
7 | /**
8 | * Hibernate-specific subclass of DataAccessException, for Hibernate system
9 | * errors that do not match any concrete com.interface21.dao exceptions.
10 | * Used by HibernateTemplate.
11 | *
12 | *
In this model, the EJB is a facade, with as many POJO helpers behind
the BeanFactory as are required.
The classes in this package are discussed in Chapter 11 of
Expert One-On-One J2EE Design and Development
by Rod Johnson (Wrox, 2002).
The present version has changed somewhat, but has the same goals.
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.
--------------------------------------------------------------------------------
/samples/petclinic/src/petclinic/NamedEntity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * NamedEntity.java
3 | *
4 | */
5 |
6 | package petclinic;
7 |
8 | /**
9 | * Simple JavaBean business object adds a name property to Entity.
10 | * Used as a base class for objects needing these properties.
11 | *
12 | * @author Ken Krebs
13 | */
14 | public class NamedEntity extends Entity {
15 |
16 | /** Holds value of property name. */
17 | private String name;
18 |
19 | /** Getter for property name.
20 | * @return Value of property name.
21 | */
22 | public String getName() {
23 | return this.name;
24 | }
25 |
26 | /** Setter for property name.
27 | * @param name New value of property name.
28 | */
29 | public void setName(String name) {
30 | this.name = name;
31 | }
32 |
33 | /** Method to copy properties from another NamedEntity.
34 | * @param entity Properties source
35 | */
36 | public void copyPropertiesFrom(NamedEntity entity) {
37 | super.copyPropertiesFrom(entity);
38 | setName(entity.getName());
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/samples/petclinic/src/petclinic/Vet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Vet.java
3 | *
4 | */
5 |
6 | package petclinic;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | * Simple JavaBean business object representing a veterinarian.
12 | *
13 | * @author Ken Krebs
14 | */
15 | public class Vet extends Person {
16 |
17 | /** Holds value of property specialties. */
18 | private List specialties;
19 |
20 | /** Getter for property specialties.
21 | * @return Value of property specialties.
22 | */
23 | public List getSpecialties() {
24 | return this.specialties;
25 | }
26 |
27 | /** Setter for property specialties.
28 | * @param specialties New value of property specialties.
29 | */
30 | public void setSpecialties(List specialties) {
31 | this.specialties = specialties;
32 | }
33 |
34 | /** Method to copy properties from another Vet.
35 | * @param vet Properties source
36 | */
37 | public void copyPropertiesFrom(Vet vet) {
38 | super.copyPropertiesFrom(vet);
39 | setSpecialties(vet.getSpecialties());
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/src/com/interface21/aop/interceptor/ClassLoaderAnalyzerInterceptor.java:
--------------------------------------------------------------------------------
1 | package com.interface21.aop.interceptor;
2 |
3 | import org.aopalliance.intercept.MethodInterceptor;
4 | import org.aopalliance.intercept.MethodInvocation;
5 | import org.apache.commons.logging.Log;
6 | import org.apache.commons.logging.LogFactory;
7 |
8 | import com.interface21.util.ClassLoaderUtils;
9 |
10 | /**
11 | * Trivial classloader analyzer interceptor.
12 | * @version $Id$
13 | * @author Rod Johnson
14 | * @author Dmitriy Kopylenko
15 | */
16 | public class ClassLoaderAnalyzerInterceptor implements MethodInterceptor {
17 |
18 | protected final Log logger = LogFactory.getLog(getClass());
19 |
20 | public Object invoke(MethodInvocation pInvocation) throws Throwable {
21 | logger.debug("Begin class loader analysis");
22 |
23 | logger.info(ClassLoaderUtils.showClassLoaderHierarchy(
24 | pInvocation.getThis(),
25 | pInvocation.getThis().getClass().getName(),
26 | "\n",
27 | "-"));
28 | Object rval = pInvocation.proceed();
29 |
30 | logger.debug("End class loader analysis");
31 | return rval;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/com/interface21/beans/NullValueInNestedPathException.java:
--------------------------------------------------------------------------------
1 |
2 | package com.interface21.beans;
3 |
4 | /**
5 | * Exception thrown when navigation of a valid nested property
6 | * path encounters a null pointer exception. For example,
7 | * navigating spouse.age fails because the spouse property of the
8 | * target object has a null value.
9 | * @author Rod Johnson
10 | */
11 | public class NullValueInNestedPathException extends FatalBeanException {
12 |
13 | private String property;
14 |
15 | private Class clazz;
16 |
17 | /**
18 | * Constructor for NullValueInNestedPathException.
19 | * @param clazz
20 | * @param propertyName
21 | */
22 | public NullValueInNestedPathException(Class clazz, String propertyName) {
23 | super("Value of nested property '" + propertyName + "' is null in " + clazz, null);
24 | this.property = propertyName;
25 | this.clazz = clazz;
26 | }
27 |
28 | /**
29 | * @return the name of the offending property
30 | */
31 | public String getPropertyName() {
32 | return property;
33 | }
34 |
35 | public Class getBeanClass() {
36 | return clazz;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/sandbox/com/interface21/core/NodeCountVisitor.java:
--------------------------------------------------------------------------------
1 |
2 | package com.interface21.core;
3 | import java.util.LinkedList;
4 | import java.util.List;
5 |
6 | /**
7 | * Test Visitor. Useful for testing.
8 | */
9 | public class NodeCountVisitor implements Visitor {
10 |
11 | private int nodeCount;
12 |
13 | private List visited = new LinkedList();
14 |
15 | /**
16 | * @see Visitor#enterComposite(Visitable, int)
17 | */
18 | public boolean enterComposite(Visitable host, int depth) {
19 | recordVisit(host);
20 | return true;
21 | }
22 |
23 | protected void recordVisit(Visitable host) {
24 | if (visited.contains(host))
25 | throw new RuntimeException("Node [" + host + "] visited twice");
26 | ++nodeCount;
27 | visited.add(host);
28 | }
29 |
30 | /**
31 | * @see Visitor#exitComposite(Visitable)
32 | */
33 | public void exitComposite(Visitable host) {
34 | }
35 |
36 | /**
37 | * @see Visitor#visitLeaf(Visitable, int)
38 | */
39 | public void visitLeaf(Visitable host, int depth) {
40 | recordVisit(host);
41 | }
42 |
43 | public int getNodeCount() {
44 | return nodeCount;
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/src/com/interface21/dao/DataIntegrityViolationException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Generic framework code included with
3 | * Expert One-On-One J2EE Design and Development
4 | * by Rod Johnson (Wrox, 2002).
5 | * This code is free to use and modify.
6 | * Please contact rod.johnson@interface21.com
7 | * for commercial support.
8 | */
9 |
10 | package com.interface21.dao;
11 |
12 | /**
13 | * Exception thrown when an attempt to insert or update data
14 | * results in violation of an integrity constraint. Note that this
15 | * is not purely a relational concept; unique primary keys are
16 | * required by most database types.
17 | * @author Rod Johnson
18 | * @version $Id$
19 | */
20 | public class DataIntegrityViolationException extends DataAccessException {
21 |
22 | /**
23 | * Constructor for DataIntegrityViolationException.
24 | * @param msg mesg
25 | * @param ex root cause
26 | */
27 | public DataIntegrityViolationException(String msg, Throwable ex) {
28 | super(msg, ex);
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/src/com/interface21/util/PagedListSourceProvider.java:
--------------------------------------------------------------------------------
1 | package com.interface21.util;
2 |
3 | import java.util.List;
4 | import java.util.Locale;
5 |
6 | /**
7 | * Callback that provides the source for a reloadable List.
8 | * Used by RefreshablePagedListHolder.
9 | * @author Jean-Pierre PAWLAK
10 | * @author Juergen Hoeller
11 | * @see RefreshablePagedListHolder#setSourceProvider
12 | */
13 | public interface PagedListSourceProvider {
14 |
15 | /**
16 | * Load the List for the given Locale and filter settings.
17 | * The filter object can be of any custom class, preferably a bean
18 | * for easy data binding from a request. An instance will simply
19 | * get passed through to this callback method.
20 | * @param locale Locale that the List should be loaded for,
21 | * or null if not locale-specific
22 | * @param filter object representing filter settings,
23 | * or null if no filter options are used
24 | * @return the loaded List
25 | * @see RefreshablePagedListHolder#setLocale
26 | * @see RefreshablePagedListHolder#setFilter
27 | */
28 | public List loadList(Locale locale, Object filter);
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/src/com/interface21/web/servlet/view/velocity/CommonsLoggingLogSystem.java:
--------------------------------------------------------------------------------
1 | package com.interface21.web.servlet.view.velocity;
2 |
3 | import org.apache.commons.logging.Log;
4 | import org.apache.commons.logging.LogFactory;
5 | import org.apache.velocity.runtime.RuntimeServices;
6 | import org.apache.velocity.runtime.log.LogSystem;
7 |
8 | /**
9 | * Velocity LogSystem implementation for Jakarta Commons Logging.
10 | * Used by VelocityConfigurer to redirect log output.
11 | * @author Juergen Hoeller
12 | * @since 07.08.2003
13 | * @see VelocityConfigurer
14 | */
15 | public class CommonsLoggingLogSystem implements LogSystem {
16 |
17 | private Log logger = LogFactory.getLog(getClass());
18 |
19 | public void init(RuntimeServices runtimeServices) {
20 | }
21 |
22 | public void logVelocityMessage(int i, String msg) {
23 | switch (i) {
24 | case ERROR_ID:
25 | logger.error(msg);
26 | break;
27 | case WARN_ID:
28 | logger.warn(msg);
29 | break;
30 | case INFO_ID:
31 | logger.info(msg);
32 | break;
33 | case DEBUG_ID:
34 | logger.debug(msg);
35 | break;
36 | }
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/src/com/interface21/aop/framework/AbstractMethodPointcut.java:
--------------------------------------------------------------------------------
1 | /*
2 | * The Spring Framework is published under the terms
3 | * of the Apache Software License.
4 | */
5 |
6 | package com.interface21.aop.framework;
7 |
8 | import org.aopalliance.intercept.MethodInterceptor;
9 |
10 | /**
11 | * Abstract convenience superclass for implementations of
12 | * DynamicMethodPointcut or StaticMethodPointcut. Handles
13 | * interceptor.
14 | * @author Rod Johnson
15 | * @since July 22, 2003
16 | * @version $Id$
17 | */
18 | public abstract class AbstractMethodPointcut implements MethodPointcut {
19 |
20 | private MethodInterceptor interceptor;
21 |
22 | protected AbstractMethodPointcut() {
23 | }
24 |
25 | protected AbstractMethodPointcut(MethodInterceptor interceptor) {
26 | this.interceptor = interceptor;
27 | }
28 | /**
29 | * @see com.interface21.aop.framework.MethodPointcut#getInterceptor()
30 | */
31 | public MethodInterceptor getInterceptor() {
32 | return this.interceptor;
33 | }
34 |
35 | public void setInterceptor(MethodInterceptor interceptor) {
36 | this.interceptor = interceptor;
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/src/com/interface21/jdbc/datasource/ConnectionHolder.java:
--------------------------------------------------------------------------------
1 | package com.interface21.jdbc.datasource;
2 |
3 | import java.sql.Connection;
4 |
5 | /**
6 | * Connection holder, wrapping a JDBC Connection.
7 | * Features rollback-only support for nested JDBC transactions.
8 | *
9 | *