Source Code Cross Referenced for PizzaDomain.java in  » Science » Cougaar12_4 » org » cougaar » pizza » 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 » Science » Cougaar12_4 » org.cougaar.pizza 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * <copyright>
003:         *  
004:         *  Copyright 1997-2004 BBNT Solutions, LLC
005:         *  under sponsorship of the Defense Advanced Research Projects
006:         *  Agency (DARPA).
007:         * 
008:         *  You can redistribute this software and/or modify it under the
009:         *  terms of the Cougaar Open Source License as published on the
010:         *  Cougaar Open Source Website (www.cougaar.org).
011:         * 
012:         *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
013:         *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
014:         *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
015:         *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
016:         *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
017:         *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
018:         *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
019:         *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
020:         *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
021:         *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
022:         *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
023:         *  
024:         * </copyright>
025:         */
026:
027:        package org.cougaar.pizza;
028:
029:        import org.cougaar.core.component.ServiceBroker;
030:        import org.cougaar.core.domain.DomainAdapter;
031:        import org.cougaar.core.mts.MessageAddress;
032:        import org.cougaar.core.service.AgentIdentificationService;
033:        import org.cougaar.core.service.DomainService;
034:        import org.cougaar.pizza.asset.AssetFactory;
035:        import org.cougaar.planning.ldm.LDMServesPlugin;
036:        import org.cougaar.planning.ldm.PlanningFactory;
037:        import org.cougaar.planning.service.LDMService;
038:
039:        import java.util.Collection;
040:        import java.util.Collections;
041:
042:        /**
043:         * PizzaDomain definition, initializing our {@link Constants} and loading our AssetFactory. 
044:         * <p>
045:         * Required to ensure that Roles and Assets specific to the pizza
046:         * application are initialized correctly. The PizzaDomain does not include any
047:         * domain specific LogicProviders. It only initializes our {@link Constants}
048:         * and loads our AssetFactory.
049:         *<p>
050:         * Other applications might have custom objects to transmit between
051:         * agents, and therefore need their own LogicProviders. Similarly,
052:         * they might want their own XPlan, to have custom-tuned lookup
053:         * methods for objects (the Planning LogPlan for example looks up
054:         * PlanElements by Task UID).
055:         **/
056:        public class PizzaDomain extends DomainAdapter {
057:
058:            /**
059:             * Name of this Domain. 
060:             * Note the <domain>_NAME variable naming pattern
061:             */
062:            public static final String PIZZA_NAME = "pizza";
063:
064:            private DomainService domainService;
065:            private LDMService ldmService;
066:
067:            public String getDomainName() {
068:                return PIZZA_NAME;
069:            }
070:
071:            public PizzaDomain() {
072:                super ();
073:            }
074:
075:            // Note the use of the introspection-based service retrieving
076:            // methods. These guarantee that the component
077:            // will not load if the services are not available.
078:
079:            public void setDomainService(DomainService domainService) {
080:                this .domainService = domainService;
081:            }
082:
083:            public void setLDMService(LDMService ldmService) {
084:                this .ldmService = ldmService;
085:            }
086:
087:            /**
088:             * Initialize this domain, specifically our {@link Constants.Roles}
089:             */
090:            public void initialize() {
091:                super .initialize();
092:
093:                // Domain is loaded before any plugins. Call to Constants.Role.init() 
094:                // creates all Roles specific to the Pizza domain before they are 
095:                // accessed by application code. This insures that that the Roles and
096:                // their converses are defined consistently.
097:                Constants.Roles.init(); // Insure that our Role constants are initted
098:            }
099:
100:            public void unload() {
101:                // Unload any services we loaded earlier
102:                ServiceBroker sb = getServiceBroker();
103:                if (ldmService != null) {
104:                    sb.releaseService(this , LDMService.class, ldmService);
105:                    ldmService = null;
106:                }
107:                if (domainService != null) {
108:                    sb.releaseService(this , DomainService.class, domainService);
109:                    domainService = null;
110:                }
111:                super .unload();
112:            }
113:
114:            public Collection getAliases() {
115:                return Collections.EMPTY_LIST;
116:            }
117:
118:            /**
119:             * Load the PlanningFactory and our Domain-specify Asset and PropertyGroup Factories
120:             **/
121:            protected void loadFactory() {
122:                LDMServesPlugin ldm = ldmService.getLDM();
123:                PlanningFactory ldmf = (PlanningFactory) ldm
124:                        .getFactory("planning");
125:                if (ldmf == null) {
126:                    throw new RuntimeException("Missing \"planning\" factory!");
127:                }
128:
129:                // Adding pizza specific AssetFactory and PropertyGroupFactory allows 
130:                // pizza application code to use ldmf.createAsset(<asset class name>) for
131:                // the assets defined in org.cougaar.pizza.asset. For example, 
132:                // ldmf.createAsset("KitchenAsset")
133:                ldmf.addAssetFactory(new AssetFactory());
134:                ldmf
135:                        .addPropertyGroupFactory(new org.cougaar.pizza.asset.PropertyGroupFactory());
136:            }
137:
138:            protected void loadXPlan() {
139:                // no Pizza specific XPlan
140:            }
141:
142:            protected void loadLPs() {
143:                // no Pizza specific LPs
144:            }
145:
146:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.