01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.superbiz.enventries;
17:
18: import javax.annotation.Resource;
19: import javax.ejb.Stateless;
20: import java.io.File;
21: import java.net.InetAddress;
22: import java.net.URI;
23: import java.net.URL;
24: import java.util.Date;
25: import java.util.List;
26: import java.util.Map;
27:
28: /**
29: * In addition to the standard env-entry types (String, Integer, Long, Short, Byte, Boolean, Double, Float, Character)
30: * OpenEJB supports many other types.
31: *
32: */
33: //START SNIPPET: code
34: @Stateless
35: public class StratocasterImpl implements Stratocaster {
36:
37: @Resource(name="pickups")
38: private List<Pickup> pickups;
39:
40: @Resource(name="style")
41: private Style style;
42:
43: @Resource(name="dateCreated")
44: private Date dateCreated;
45:
46: @Resource(name="guitarStringGuages")
47: private Map<String, Float> guitarStringGuages;
48:
49: @Resource(name="certificateOfAuthenticity")
50: private File certificateOfAuthenticity;
51:
52: public Date getDateCreated() {
53: return dateCreated;
54: }
55:
56: /**
57: * Gets the guage of the electric guitar strings
58: * used in this guitar.
59: * @param string
60: * @return
61: */
62: public float getStringGuage(String string) {
63: return guitarStringGuages.get(string);
64: }
65:
66: public List<Pickup> getPickups() {
67: return pickups;
68: }
69:
70: public Style getStyle() {
71: return style;
72: }
73:
74: public File getCertificateOfAuthenticity() {
75: return certificateOfAuthenticity;
76: }
77: }
78: //END SNIPPET: code
|