001: /*
002: * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
003: *
004: * Redistribution and use in source and binary forms, with or without
005: * modification, are permitted provided that the following conditions
006: * are met:
007: *
008: * - Redistributions of source code must retain the above copyright
009: * notice, this list of conditions and the following disclaimer.
010: *
011: * - Redistribution in binary form must reproduce the above copyright
012: * notice, this list of conditions and the following disclaimer in
013: * the documentation and/or other materials provided with the
014: * distribution.
015: *
016: * Neither the name of Sun Microsystems, Inc. or the names of
017: * contributors may be used to endorse or promote products derived
018: * from this software without specific prior written permission.
019: *
020: * This software is provided "AS IS," without a warranty of any
021: * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
022: * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
023: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
024: * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
025: * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
026: * DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
027: * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
028: * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
029: * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
030: * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE,
031: * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
032: *
033: * You acknowledge that Software is not designed, licensed or intended
034: * for use in the design, construction, operation or maintenance of
035: * any nuclear facility.
036: */
037:
038: package com.sun.j2ee.blueprints.customer.profile.ejb;
039:
040: import javax.ejb.EntityContext;
041: import javax.ejb.RemoveException;
042: import javax.ejb.CreateException;
043: import javax.naming.NamingException;
044: import javax.naming.InitialContext;
045:
046: public abstract class ProfileEJB implements javax.ejb.EntityBean {
047:
048: private EntityContext context = null;
049:
050: // getters and setters for CMP fields
051: //====================================
052: public abstract String getPreferredLanguage();
053:
054: public abstract void setPreferredLanguage(String preferredLanguage);
055:
056: public abstract String getFavoriteCategory();
057:
058: public abstract void setFavoriteCategory(String category);
059:
060: public abstract boolean getMyListPreference();
061:
062: public abstract void setMyListPreference(boolean myListPreference);
063:
064: public abstract boolean getBannerPreference();
065:
066: public abstract void setBannerPreference(boolean bannerPreference);
067:
068: // EJB create method
069: //===================
070: public Object ejbCreate(String preferredLanguage,
071: String favoriteCategory, boolean myListPreference,
072: boolean bannerPreference) throws CreateException {
073: setPreferredLanguage(preferredLanguage);
074: setFavoriteCategory(favoriteCategory);
075: setMyListPreference(myListPreference);
076: setBannerPreference(bannerPreference);
077: return null;
078: }
079:
080: // Misc Method
081: //=============
082: public void ejbPostCreate(String preferredLanguage,
083: String favoriteCategory, boolean myListPreference,
084: boolean bannerPreference) throws CreateException {
085: }
086:
087: public void setEntityContext(EntityContext c) {
088: context = c;
089: }
090:
091: public void unsetEntityContext() {
092: context = null;
093: }
094:
095: public void ejbRemove() throws RemoveException {
096: }
097:
098: public void ejbActivate() {
099: }
100:
101: public void ejbPassivate() {
102: }
103:
104: public void ejbStore() {
105: }
106:
107: public void ejbLoad() {
108: }
109: }
|