Source Code Cross Referenced for Constants.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 2002-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:        package org.cougaar.pizza;
027:
028:        import org.cougaar.planning.ldm.plan.Verb;
029:
030:        import java.io.File;
031:
032:        /**
033:         * Constants for the pizza party application. Initialized by the 
034:         * load of the {@link PizzaDomain}, so Roles in particular are well defined.
035:         * 
036:         * Having a Domain-specific Constants file for Roles, Verbs, 
037:         * and other objects that Plugins will match on off the Blackboard
038:         * is fairly typical usage.
039:         */
040:        public class Constants {
041:            // Private constructor prevents instantiation
042:            private Constants() {
043:            }
044:
045:            // Some heavily used Strings. In particular, the invitation Relay
046:            // uses these.
047:            public static final String PIZZA = "Pizza";
048:            public static final String INVITATION_QUERY = "Come to my party! RSVP: Meat or Veggie Pizza?";
049:            public static final String MEAT_PIZZA = "Meat Pizza";
050:            public static final String VEGGIE_PIZZA = "Veggie Pizza";
051:
052:            /** Name of Alice's buddy list - her friends to invite. */
053:            public static final String COMMUNITY = "FriendsOfMark-COMM";
054:
055:            // Standard constants for Role definition. Defined here
056:            // to avoid GLM dependency
057:            public static final String PROVIDER_SUFFIX = "Provider";
058:            public static final String CUSTOMER_SUFFIX = "Customer";
059:
060:            /** used when showing how long it takes for this number of friends to reply */
061:            public static final int EXPECTED_NUM_FRIENDS = 4;
062:
063:            /**
064:             * Verbs used by the Pizza application plugins.
065:             */
066:            public interface Verbs {
067:                /** Verb for ordering pizzas */
068:                public static final Verb ORDER = Verb.get("Order");
069:                /** SDPlaceOrderPlugin uses to Initiates service discovery to find a provider */
070:                public static final Verb FIND_PROVIDERS = Verb
071:                        .get("FindProviders");
072:            }
073:
074:            /**
075:             * Special Prepositions used by the pizza application
076:             */
077:            public interface Prepositions {
078:                /** Used in excluding a particular provider (see SDPlaceOrderPlugin) */
079:                public static final String NOT = "Not";
080:            }
081:
082:            /**
083:             * Relationship Types needed by the Pizza application
084:             */
085:            public interface RelationshipTypes {
086:                /**
087:                 * A service providing relationship
088:                 */
089:                org.cougaar.planning.ldm.plan.RelationshipType PROVIDER = org.cougaar.planning.ldm.plan.RelationshipType
090:                        .create(PROVIDER_SUFFIX, CUSTOMER_SUFFIX);
091:            }
092:
093:            /**
094:             * Roles used on Assets in the Pizza application.
095:             */
096:            public static class Roles {
097:                /**
098:                 * Ensure that Role constants are initialized. Actually does nothing, but
099:                 * the classloader ensures that all static initializers have been run 
100:                 * before executing any code in this class. This ensures that Roles 
101:                 * required for the Pizza app are created properly before a application
102:                 * code calls Role.get(Constants.Role.XXX)
103:                 *<p>
104:                 * All Roles have a converse - PizzaProvider/PizzaConsumer for example.
105:                 * The following Role.create calls specify both the Role and its converse. 
106:                 * In the case of the Carnivore Role - the Role and its converse are the
107:                 * same. The call to create PizzaProvider, however, designates 
108:                 * PizzaConsumer as the converse. (See RelationshipType.PROVIDER definition
109:                 * above.
110:                 *<p>
111:                 * If Role.get(XXX) is called before a proper Role.create, the Role code 
112:                 * will create a default pairing of XXX and ConverseOfXXX Roles. The 
113:                 * ConverseOfXXX Role is typically unusable.
114:                 */
115:                public static void init() {
116:                }
117:
118:                static {
119:                    org.cougaar.planning.ldm.plan.Role.create(Constants.PIZZA,
120:                            RelationshipTypes.PROVIDER);
121:                    org.cougaar.planning.ldm.plan.Role.create("Carnivore",
122:                            "Carnivore");
123:                    org.cougaar.planning.ldm.plan.Role.create("Vegetarian",
124:                            "Vegetarian");
125:                }
126:
127:                // organization roles
128:                /**
129:                 * Someone who wants a meat pizza
130:                 */
131:                public static final org.cougaar.planning.ldm.plan.Role CARNIVORE = org.cougaar.planning.ldm.plan.Role
132:                        .getRole("Carnivore");
133:                /**
134:                 * Someone who wants a Veggie pizza - no meat!
135:                 */
136:                public static final org.cougaar.planning.ldm.plan.Role VEGETARIAN = org.cougaar.planning.ldm.plan.Role
137:                        .getRole("Vegetarian");
138:                /**
139:                 * An Agent that provides the PizzaProvider service
140:                 */
141:                public static final org.cougaar.planning.ldm.plan.Role PIZZAPROVIDER = org.cougaar.planning.ldm.plan.Role
142:                        .getRole(Constants.PIZZA + PROVIDER_SUFFIX);
143:                /**
144:                 * The inverse of a PizzaProvider; orders pizza.
145:                 */
146:                public static final org.cougaar.planning.ldm.plan.Role PIZZACUSTOMER = org.cougaar.planning.ldm.plan.Role
147:                        .getRole(Constants.PIZZA + CUSTOMER_SUFFIX);
148:            }
149:
150:            /**
151:             * Returns the path to the data files required to support the pizza application e.g.
152:             * $COUGAAR_INSTALL_PATH/pizza/data
153:             * Used by ServiceDiscovery in particular.
154:             *
155:             * @return a string representing the file path
156:             */
157:            public static String getDataPath() {
158:                return System.getProperty("org.cougaar.install.path")
159:                        + File.separator + "pizza" + File.separator + "data";
160:            }
161:
162:            /**
163:             * Constants needed for ServiceDiscovery in the Pizza application.
164:             */
165:            public interface UDDIConstants {
166:                // References pizza/data/taxonomies/CommercialServiceScheme-yp.xml which
167:                // defines the set of Roles which a provider can register.
168:                public final static String COMMERCIAL_SERVICE_SCHEME = "CommercialServiceScheme";
169:                // References pizza/data/taxonomies/OrganizationTypes-yp.xml which
170:                // defines the type of provider e.g. Military vs Commercial
171:                public final static String ORGANIZATION_TYPES = "OrganizationTypes";
172:            }
173:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.