Source Code Cross Referenced for ServiceContainer.java in  » Portal » Open-Portal » com » sun » portal » common » service » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » Open Portal » com.sun.portal.common.service 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // ***************************************************************
002:        // *                                                             *
003:        // * File:ServiceContainer.java                                  *
004:        // *                                                             *
005:        // *  Copyright (c) 2002 Sun Microsystems, Inc.                  *
006:        // *  All rights reserved.                                       *
007:        // *                                                             *
008:        // *                                                             *
009:        // * Date      - Jul/16/2002                                     *
010:        // * Author    - alejandro.abdelnur@sun.com                      *
011:        // *                                                             *
012:        // ***************************************************************
013:        package com.sun.portal.common.service;
014:
015:        import com.sun.portal.common.service.impl.ServiceContainerImpl;
016:
017:        /**
018:         * A ServiceContainer is a singleton that manages a collection
019:         * of ServiceContexts.
020:         * <P>
021:         * The container implementation class can be specified as a system
022:         * property. If it's not specified the default container implementation
023:         * will be used, com.sun.portal.common.service.impl.ServiceContainerImpl
024:         * <P>
025:         * The default container implementation has a DEFAULT_CONTEXT only.
026:         * This context initializes all the services described in the service.xml
027:         * file that has to be available in the root of the classpath.
028:         * <P>
029:         *
030:         * @author <A HREF="mailto:tucu@sun.com">Alejandro Abdelnur</A>
031:         *
032:         */
033:        public abstract class ServiceContainer {
034:
035:            /**
036:             * String constant that defined the system propoperty that it
037:             * will be queried to obtain the name of the ServiceContainer
038:             * class to use.
039:             * <P>
040:             * It's value is com.sun.portal.common.service.container.class
041:             */
042:            public static final String SERVICE_CONTAINER_CLASS = "com.sun.portal.common.service.ServiceContainer.class";
043:
044:            private static ServiceContainer _container;
045:
046:            static {
047:                try {
048:                    String className = System
049:                            .getProperty(SERVICE_CONTAINER_CLASS);
050:                    Class clazz = Class.forName(className);
051:                    _container = (ServiceContainer) clazz.newInstance();
052:                } catch (Exception ex) {
053:                }
054:                if (_container == null) {
055:                    _container = new ServiceContainerImpl();
056:                }
057:            }
058:
059:            /**
060:             * String constant used to retrieve the default context of a
061:             * container.
062:             * <P>
063:             *
064:             */
065:            public static final String DEFAULT_CONTEXT = "default";
066:
067:            /**
068:             * Return the ServiceContainer object.
069:             * <P>
070:             *
071:             * @return the ServiceContainer object
072:             *
073:             */
074:            public static ServiceContainer getContainer() {
075:                return _container;
076:            }
077:
078:            /**
079:             * Initializes the ServiceContainer object.
080:             * <P>
081:             * This method must be called before any ServiceContext
082:             * can be retrieved from the container.
083:             * The init method must complete successfully in order
084:             * for the container to be operational.
085:             * <P>
086:             *
087:             * @throws ServiceException if an exception has occurred
088:             *         that interferes with the container's normal
089:             *         initialization
090:             *
091:             */
092:            public abstract void init() throws ServiceException;
093:
094:            /**
095:             * Returns the named ServiceContext of the container.
096:             * <P>
097:             * If the DEFAULT_CONTEXT constant is used, the default
098:             * context must be returned. A container always has a
099:             * default context.
100:             * <P>
101:             *
102:             * @param name a String containing the name of the context
103:             *        to retrieve
104:             *
105:             * @return the ServiceContext with the given name, or null
106:             *         if the context does not exist
107:             *
108:             */
109:            public abstract ServiceContext getContext(String name);
110:
111:            /**
112:             * Destroys the ServiceContainer object.
113:             * <P>
114:             * This method must be called to take the container out of
115:             * service. After this method completes, the container
116:             * is not active anymore.
117:             * <P>
118:             * This method gives the container an opportunity to clean
119:             * up any resources that are being held (for example, memory,
120:             * file handles, threads).
121:             * <P>
122:             *
123:             */
124:            public abstract void destroy();
125:
126:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.