Reference Documentation

Total Page:16

File Type:pdf, Size:1020Kb

Reference Documentation Reference Documentation Version 1.2.7 (Work in progress) Copyright (c) 2004-2006 Rod Johnson, Juergen Hoeller, Alef Arendsen, Colin Sampaleanu, Rob Harrop, Thomas Risberg, Darren Davison, Dmitriy Kopylenko, Mark Pollack, Thierry Templier, Erwin Vervaet Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically. Table of Contents Preface ................................................................................................................................................ 1. Introduction .................................................................................................................................. 1.1. Overview ............................................................................................................................. 1 1.2. Usage scenarios .................................................................................................................... 2 2. Background information ............................................................................................................... 2.1. Inversion of Control / Dependency Injection .......................................................................... 5 3. Beans, BeanFactory and the ApplicationContext .......................................................................... 3.1. Introduction ......................................................................................................................... 6 3.2. BeanFactory and BeanDefinitions - the basics ........................................................................ 6 3.2.1. The BeanFactory ....................................................................................................... 6 3.2.2. The BeanDefinition ................................................................................................... 8 3.2.3. The bean class ........................................................................................................... 8 3.2.4. The bean identifiers (id and name) ............................................................................................................................ 10 3.2.5. To singleton or not to singleton .................................................................................. 10 3.3. Properties, collaborators, autowiring and dependency checking .................................................................................................................................. 11 3.3.1. Setting bean properties and collaborators .................................................................... 11 3.3.2. Constructor Argument Resolution ............................................................................... 14 3.3.3. Bean properties and constructor arguments detailed ..................................................... 15 3.3.4. Method Injection ....................................................................................................... 19 3.3.5. Using depends-on ...................................................................................................... 21 3.3.6. Autowiring collaborators ............................................................................................ 22 3.3.7. Checking for dependencies ......................................................................................... 23 3.4. Customizing the nature of a bean ........................................................................................... 23 3.4.1. Lifecycle interfaces ................................................................................................... 24 3.4.2. Knowing who you are ................................................................................................ 25 3.4.3. FactoryBean .............................................................................................................. 26 3.5. Abstract and child bean definitions ........................................................................................ 26 3.6. Interacting with the BeanFactory ........................................................................................... 27 3.6.1. Obtaining a FactoryBean, not its product ..................................................................... 28 3.7. Customizing beans with BeanPostProcessors ......................................................................... 28 3.8. Customizing bean factories with BeanFactoryPostProcessors .................................................. 28 3.8.1. The PropertyPlaceholderConfigurer ............................................................................ 29 3.8.2. The PropertyOverrideConfigurer ................................................................................ 30 3.9. Registering additional custom PropertyEditors ....................................................................... 30 3.10. Using the alias element to add aliases for existing beans ....................................................... 31 3.11. Introduction to the ApplicationContext ................................................................................ 32 3.12. Added functionality of the ApplicationContext .................................................................................................................. 32 3.12.1. Using the MessageSource ......................................................................................... 32 3.12.2. Propagating events ................................................................................................... 33 3.12.3. Low-level resources and the application context ........................................................ 34 3.13. Customized behavior in the ApplicationContext ................................................................... 35 3.13.1. ApplicationContextAware marker interface ........................................................................................................................ 35 3.13.2. The BeanPostProcessor ............................................................................................ 35 3.13.3. The BeanFactoryPostProcessor ................................................................................. 35 Spring Framework Version 1.2.7 ii Spring - Java/J2EE Application Framework 3.13.4. The PropertyPlaceholderConfigurer .......................................................................... 36 3.14. Registering additional custom PropertyEditors ..................................................................... 36 3.15. Setting a bean property or constructor arg from a property expression ............................................................................................................................... 37 3.16. Setting a bean property or constructor arg from a field value ....................................................................................................................................... 38 3.17. Invoking another method and optionally using the return value. ...................................................................................................................................... 38 3.18. Importing Bean Definitions from One File Into Another ....................................................... 39 3.19. Creating an ApplicationContext from a web application ........................................................ 40 3.20. Glue code and the evil singleton .......................................................................................... 41 3.20.1. Using SingletonBeanFactoryLocator and ContextSingletonBeanFactoryLocator ............................................................................. 41 4. Abstracting Access to Low-Level Resources .................................................................................. 4.1. Overview ............................................................................................................................. 43 4.2. The Resource interface ......................................................................................................... 43 4.3. Built-in Resource implementations ........................................................................................ 44 4.3.1. UrlResource .............................................................................................................. 44 4.3.2. ClassPathResource .................................................................................................... 44 4.3.3. FileSystemResource .................................................................................................. 45 4.3.4. ServletContextResource ............................................................................................. 45 4.3.5. InputStreamResource ................................................................................................. 45 4.3.6. ByteArrayResource ................................................................................................... 45 4.4. The ResourceLoader Interface ............................................................................................... 45 4.5. The ResourceLoaderAware interface ..................................................................................... 46 4.6. Setting Resources as properties ............................................................................................. 46 4.7. Application contexts and Resource
Recommended publications
  • J2EE Development Standards
    Indiana University J2EE Development Standards University Information Systems September 2004 Version 1.4 Table of Contents Introduction............................................................................................................... 3 Methodology..............................................................................................................6 Architecture...............................................................................................................12 Coding Conventions..................................................................................................18 Standard Libraries ....................................................................................................20 Tools ..........................................................................................................................21 Development Platform ..............................................................................................22 Shared Services .........................................................................................................23 Deployment................................................................................................................24 References and Links................................................................................................26 Appendices.................................................................................................................28 J2EE Development Standards v1.4 - 2 - J2EE Development Standards: Introduction
    [Show full text]
  • Javaedge Setup and Installation
    APPENDIX A ■ ■ ■ JavaEdge Setup and Installation Throughout the book, we have used the example application, JavaEdge, to provide a practical demonstration of all the features discussed. In this appendix, we will walk you through setting up the tools and applications required to build and run JavaEdge, as well as take you through the steps needed to get the JavaEdge application running on your platform. Environment Setup Before you can get started with the JavaEdge application, you need to configure your platform to be able to build and run JavaEdge. Specifically, you need to configure Apache Ant in order to build the JavaEdge application and package it up for deployment. In addition, the JavaEdge application is designed to run on a J2EE application server and to use MySQL as the back-end database. You also need to have a current JDK installed; the JavaEdge application relies on JVM version 1.5 or higher, so make sure your JDK is compatible. We haven’t included instruc- tions for this here, since we are certain that you will already have a JDK installed if you are reading this book. However, if you do need to download one, you can find it at http://java. sun.com/j2se/1.5.0/download.jsp. Installing MySQL The JavaEdge application uses MySQL as the data store for all user, story, and comment data. If you don’t already have the MySQL database server, then you need to obtain the version applicable to your platform. You can obtain the latest production binary release of MySQL for your platform at http://www.mysql.com.
    [Show full text]
  • Full-Graph-Limited-Mvn-Deps.Pdf
    org.jboss.cl.jboss-cl-2.0.9.GA org.jboss.cl.jboss-cl-parent-2.2.1.GA org.jboss.cl.jboss-classloader-N/A org.jboss.cl.jboss-classloading-vfs-N/A org.jboss.cl.jboss-classloading-N/A org.primefaces.extensions.master-pom-1.0.0 org.sonatype.mercury.mercury-mp3-1.0-alpha-1 org.primefaces.themes.overcast-${primefaces.theme.version} org.primefaces.themes.dark-hive-${primefaces.theme.version}org.primefaces.themes.humanity-${primefaces.theme.version}org.primefaces.themes.le-frog-${primefaces.theme.version} org.primefaces.themes.south-street-${primefaces.theme.version}org.primefaces.themes.sunny-${primefaces.theme.version}org.primefaces.themes.hot-sneaks-${primefaces.theme.version}org.primefaces.themes.cupertino-${primefaces.theme.version} org.primefaces.themes.trontastic-${primefaces.theme.version}org.primefaces.themes.excite-bike-${primefaces.theme.version} org.apache.maven.mercury.mercury-external-N/A org.primefaces.themes.redmond-${primefaces.theme.version}org.primefaces.themes.afterwork-${primefaces.theme.version}org.primefaces.themes.glass-x-${primefaces.theme.version}org.primefaces.themes.home-${primefaces.theme.version} org.primefaces.themes.black-tie-${primefaces.theme.version}org.primefaces.themes.eggplant-${primefaces.theme.version} org.apache.maven.mercury.mercury-repo-remote-m2-N/Aorg.apache.maven.mercury.mercury-md-sat-N/A org.primefaces.themes.ui-lightness-${primefaces.theme.version}org.primefaces.themes.midnight-${primefaces.theme.version}org.primefaces.themes.mint-choc-${primefaces.theme.version}org.primefaces.themes.afternoon-${primefaces.theme.version}org.primefaces.themes.dot-luv-${primefaces.theme.version}org.primefaces.themes.smoothness-${primefaces.theme.version}org.primefaces.themes.swanky-purse-${primefaces.theme.version}
    [Show full text]
  • Abkürzungs-Liste ABKLEX
    Abkürzungs-Liste ABKLEX (Informatik, Telekommunikation) W. Alex 1. Juli 2021 Karlsruhe Copyright W. Alex, Karlsruhe, 1994 – 2018. Die Liste darf unentgeltlich benutzt und weitergegeben werden. The list may be used or copied free of any charge. Original Point of Distribution: http://www.abklex.de/abklex/ An authorized Czechian version is published on: http://www.sochorek.cz/archiv/slovniky/abklex.htm Author’s Email address: [email protected] 2 Kapitel 1 Abkürzungen Gehen wir von 30 Zeichen aus, aus denen Abkürzungen gebildet werden, und nehmen wir eine größte Länge von 5 Zeichen an, so lassen sich 25.137.930 verschiedene Abkür- zungen bilden (Kombinationen mit Wiederholung und Berücksichtigung der Reihenfol- ge). Es folgt eine Auswahl von rund 16000 Abkürzungen aus den Bereichen Informatik und Telekommunikation. Die Abkürzungen werden hier durchgehend groß geschrieben, Akzente, Bindestriche und dergleichen wurden weggelassen. Einige Abkürzungen sind geschützte Namen; diese sind nicht gekennzeichnet. Die Liste beschreibt nur den Ge- brauch, sie legt nicht eine Definition fest. 100GE 100 GBit/s Ethernet 16CIF 16 times Common Intermediate Format (Picture Format) 16QAM 16-state Quadrature Amplitude Modulation 1GFC 1 Gigabaud Fiber Channel (2, 4, 8, 10, 20GFC) 1GL 1st Generation Language (Maschinencode) 1TBS One True Brace Style (C) 1TR6 (ISDN-Protokoll D-Kanal, national) 247 24/7: 24 hours per day, 7 days per week 2D 2-dimensional 2FA Zwei-Faktor-Authentifizierung 2GL 2nd Generation Language (Assembler) 2L8 Too Late (Slang) 2MS Strukturierte
    [Show full text]
  • Doktora Tezi
    A METRICS-BASED APPROACH TO THE TESTING PROCESS AND TESTABILITY OF OBJECT-ORIENTED SOFTWARE SYSTEMS A THESIS SUBMITTED TO THE GRADUATE SCHOOL OF INFORMATICS OF THE MIDDLE EAST TECHNICAL UNIVERSITY BY TOLGA YURGA IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY IN THE DEPARTMENT OF INFORMATION SYSTEMS FEBRUARY 2009 Approval of the Graduate School of Informatics Prof. Dr. Nazife BAYKAL Director I certify that this thesis satisfies all the requirements as a thesis for the degree of Doctor of Philosophy. Prof. Dr. Yasemin YARDIMCI Head of Department This is to certify that we have read this thesis and that in our opinion it is fully adequate, in scope and quality, as a thesis for the degree of Doctor of Philosophy. Prof. Dr. Semih BİLGEN Assoc. Prof. Ali H. DOĞRU Co-Supervisor Supervisor Examining Committee Members Dr. Ali ARİFOĞLU (METU, II) Assoc. Prof. Ali H. DOĞRU (METU, CENG) Prof. Dr. Semih BİLGEN (METU, EEE) Assist. Prof. Dr. Aysu Betin CAN (METU, II) Dr. Sadık EŞMELİOĞLU (BİLGİ GRUBU) I hereby declare that all information in this document has been obtained and presented in accordance with academic rules and ethical conduct. I also declare that, as required by these rules and conduct, I have fully cited and referenced all material and results that are not original to this wok. Name, Last name : Tolga YURGA Signature : _________________ iii ABSTRACT A METRICS-BASED APPROACH TO THE TESTING PROCESS AND TESTABILITY OF OBJECT-ORIENTED SOFTWARE SYSTEMS Yurga, Tolga Ph.D., Department of Information Systems Supervisor: Assoc. Prof. Dr. Ali Hikmet DOĞRU Co-Supervisor: Prof.
    [Show full text]
  • Introducing the Spring Framework
    04_574833 ch01.qxd 6/10/05 12:49 PM Page 1 Introducing the Spring Framework Why Spring? The Spring Framework is an open source application framework that aims to make J2EE develop- ment easier. In this chapter we’ll look at the motivation for Spring, its goals, and how Spring can help you develop high-quality applications quickly. Spring is an application framework. Unlike single-tier frameworks such as Struts or Hibernate, Spring aims to help structure whole applications in a consistent, produc- tive manner, pulling together best-of-breed single-tier frameworks to create a coher- ent architecture. Problems with the Traditional Approach to J2EE Since the widespread implementation of J2EE applications in 1999/2000, J2EE has not been an unqualified successCOPYRIGHTED in practice. While it has brought aMATERIAL welcome standardization to core middle- tier concepts such as transaction management, many — perhaps most — J2EE applications are over- complex, take excessive effort to develop, and exhibit disappointing performance. While Spring is applicable in a wide range of environments — not just server-side J2EE applications — the original motivation for Spring was the J2EE environment, and Spring offers many valuable services for use in J2EE applications. Experience has highlighted specific causes of complexity and other problems in J2EE applications. (Of course, not all of these problems are unique to J2EE!) In particular: 04_574833 ch01.qxd 6/10/05 12:49 PM Page 2 Chapter 1 ❑ J2EE applications tend to contain excessive amounts of “plumbing” code. In the many code reviews we’ve done as consultants, time and time again we see a high proportion of code that doesn’t do anything: JNDI lookup code, Transfer Objects, try/catch blocks to acquire and release JDBC resources.
    [Show full text]
  • Architectural, Technological and Performance Issues in Enterprise Applications
    World Academy of Science, Engineering and Technology International Journal of Computer and Systems Engineering Vol:1, No:3, 2007 Architectural, Technological and Performance Issues in Enterprise Applications Melek Oktay, Ayşe Betül Gülbağcı, and Mustafa Sarıöz According to the success and failure percentages, it can be Abstract—Enterprise applications are complex systems that are indicated that it is very hard to achieve success in enterprise hard to develop and deploy in organizations. Although software applications. application development tools, frameworks, methodologies and A large number of people at different backgrounds are patterns are rapidly developing; many projects fail by causing big involved in enterprise applications. There are complex costs. There are challenging issues that programmers and designers businesses, management and technical issues which are face with while working on enterprise applications. In this paper, we difficult to control. Also it takes 6-7 years to complete an present the three of the significant issues: Architectural, technological and performance. The important subjects in each issue enterprise application from early design to successful are pointed out and recommendations are given. In architectural company transformation [3]. Therefore, it is not unusual to issues the lifecycle, meta-architecture, guidelines are pointed out. have so many problems like over-budgeting, over-time in .NET and Java EE platforms are presented in technological issues. enterprise applications. There are many pitfalls, bottlenecks The importance of performance, measuring performance and and confusing works from beginning to end of an enterprise profilers are explained in performance issues. application. In this paper we propose to analyze the significant issues in Keywords—Enterprise Applications, Architecture, Technology, enterprise applications.
    [Show full text]
  • Introduction to Spring 2 and JPA Explore the Spring 2 Framework and the Java Persistence API with Eclipse and DB2 Express-C
    Introduction to Spring 2 and JPA Explore the Spring 2 framework and the Java Persistence API with Eclipse and DB2 Express-C Skill Level: Introductory Sing Li ([email protected]) Author Wrox Press 08 Aug 2006 Java™ server applications need not be difficult and tedious to create. Now in its second generation, the lightweight Spring framework adds a large suite of features that make it simple for even new server application developers to use. One key enhancement is Spring 2's integration with the Java Persistence API (JPA), a cornerstone of the Enterprise JavaBeans (EJB) 3.0 specification. In this tutorial, learn how to create server applications from scratch using the Spring 2 framework. Section 1. Before you start For almost a decade, the "proper" way to build a robust and maintainable server-side Java application has been the exclusive domain of the Java 2 Enterprise Edition (J2EE) platform. J2EE applications are built using Enterprise JavaBeans (EJB) technology and run on servers that facilitate deployment and provide rich container services (such as the management of database connections and pooling). These servers also add value by providing deploy-time declarative control of important features such as security and transactions. Although versatile, the J2EE development process involves many tedious and repetitive tasks and the creation and maintenance of large numbers of source code files. Many lightweight Java frameworks claim to simplify server application development, but none matches the Spring framework in maturity and popularity (see Resources). Introduction to Spring 2 and JPA © Copyright IBM Corporation 1994, 2008. All rights reserved. Page 1 of 67 developerWorks® ibm.com/developerWorks Now in version 2, Spring was designed from day one to simplify the server application building process.
    [Show full text]
  • Beginning Pojo.Pdf
    Sam-Bodden_596-3 FRONT.fm Page i Friday, February 24, 2006 9:59 AM Beginning POJOs From Novice to Professional ■■■ Brian Sam-Bodden Sam-Bodden_596-3 FRONT.fm Page ii Friday, February 24, 2006 9:59 AM Beginning POJOs: From Novice to Professional Copyright © 2006 by Brian Sam-Bodden All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-159059-596-1 ISBN-10 (pbk): 1-59059-596-3 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Lead Editor: Steve Anglin Technical Reviewer: Dilip Thomas Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Jason Gilmore, Jonathan Hassell, James Huddleston, Chris Mills, Matthew Moodie, Dominic Shakeshaft, Jim Sumser, Matt Wade Project Manager: Kylie Johnston Copy Edit Manager: Nicole LeClerc Copy Editor: Hastings Hart Assistant Production Director: Kari Brooks-Copony Production Editor: Katie Stence Compositor: Susan Glinert Proofreader: Lori Bring Indexer: Michael Brinkman Artist: April Milne Cover Designer: Kurt Krames Manufacturing Director: Tom Debolski Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013.
    [Show full text]
  • ASF FY2021 Annual Report
    0 Contents The ASF at-a-Glance 4 President’s Report 6 Treasurer’s Report 8 FY2021 Financial Statement 12 Fundraising 14 Legal Affairs 19 Infrastructure 21 Security 22 Data Privacy 25 Marketing & Publicity 26 Brand Management 40 Conferences 43 Community Development 44 Diversity & Inclusion 46 Projects and Code 48 Contributions 65 ASF Members 72 Emeritus Members 77 Memorial 78 Contact 79 FY2021 Annual Report Page 1 The ASF at-a-Glance "The Switzerland of Open Source..." — Matt Asay, InfoWorld The World’s Largest Open Source Foundation The Apache Software Foundation (ASF) incorporated in 1999 with the mission of providing software for the common good. Today the ASF is the world’s largest Open Source foundation, stewarding 227M+ lines of code and providing $22B+ worth of software to the public at 100% no cost. ASF projects are integral to nearly every aspect of modern computing, benefitting billions worldwide. Change Agents The ASF was founded by developers of the Apache HTTP Server to protect the core interests of those contributing to and using our open source projects. The ASF’s all-volunteer community now includes over 8,200 committers, involved in over 350 projects that have been organized by about 200 independent project management committees, and is overseen by 850+ ASF members. The Foundation is a globally-distributed, virtual organization with contributors on every continent. Apache projects power countless mission-critical solutions worldwide, and have spearheaded industry breakthroughs in dozens of categories, from Big Data to Web Frameworks. More than three dozen future projects and their communities are currently being mentored in the Apache Incubator.
    [Show full text]
  • Hyperion System 9 BI+ Application Builder Administrator's Guide
    HYPERION® SYSTEM™ 9 BI+™ APPLICATION BUILDER J2EE™ RELEASE 9.2 SYSTEM ADMINISTRATOR’S GUIDE Copyright 1998–2006 Hyperion Solutions Corporation. All rights reserved. “Hyperion,” the Hyperion “H” logo, and Hyperion’s product names are trademarks of Hyperion. References to other companies and their products use trademarks owned by the respective companies and are for reference purpose only. No portion hereof may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or information storage and retrieval systems, for any purpose other than the recipient’s personal use, without the express written permission of Hyperion. The information contained herein is subject to change without notice. Hyperion shall not be liable for errors contained herein or consequential damages in connection with the furnishing, performance, or use hereof. Any Hyperion software described herein is licensed exclusively subject to the conditions set forth in the Hyperion license agreement. Use, duplication or disclosure by the U.S. Government is subject to restrictions set forth in the applicable Hyperion license agreement and as provided in DFARS 227.7202-1(a) and 227.7202-3(a) (1995), DFARS 252.227-7013(c)(1)(ii) (Oct 1988), FAR 12.212(a) (1995), FAR 52.227-19, or FAR 52.227-14, as applicable. Hyperion Solutions Corporation 5450 Great America Parkway Santa Clara, California 95054 Printed in the U.S.A. Contents Preface . 9 Purpose . 9 Audience . 9 Document Structure . 9 Where to Find Documentation . 10 Conventions . 12 Additional Support . 13 Education Services . 13 Consulting Services . 13 Technical Support . 13 Documentation Feedback .
    [Show full text]
  • Professional Portal Development with Open Source Tools: Java™ Portlet API, Lucene, James, Slide
    01 469513 FM.qxd 1/16/04 11:04 AM Page iii Professional Portal Development with Open Source Tools: Java™ Portlet API, Lucene, James, Slide W. Clay Richardson Donald Avondolio Joe Vitale Peter Len Kevin T. Smith Wiley Technology Publishing 01 469513 FM.qxd 1/16/04 11:04 AM Page ii 01 469513 FM.qxd 1/16/04 11:04 AM Page i Professional Portal Development with Open Source Tools: Java™ Portlet API, Lucene, James, Slide 01 469513 FM.qxd 1/16/04 11:04 AM Page ii 01 469513 FM.qxd 1/16/04 11:04 AM Page iii Professional Portal Development with Open Source Tools: Java™ Portlet API, Lucene, James, Slide W. Clay Richardson Donald Avondolio Joe Vitale Peter Len Kevin T. Smith Wiley Technology Publishing 01 469513 FM.qxd 1/16/04 11:04 AM Page iv Professional Portal Development with Open Source Tools: Java™ Portlet API, Lucene, James, Slide Published by Wiley Publishing, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.com Copyright © 2004 by W. Clay Richardson, Donald Avondolio, Joseph Vitale, Peter Len, and Kevin T. Smith, All rights reserved. Published by Wiley Publishing, Inc., Indianapolis, Indiana Published simultaneously in Canada No partof this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600.
    [Show full text]