1 28 29 package com.caucho.ejb.cfg; 30 31 import com.caucho.config.ConfigException; 32 import com.caucho.config.types.Signature; 33 import com.caucho.j2ee.cfg.J2eeSecurityRole; 34 import com.caucho.util.L10N; 35 36 import javax.annotation.PostConstruct; 37 38 41 public class EjbJar { 42 private static final L10N L = new L10N(EjbJar.class); 43 44 private final EjbConfig _config; 45 private final String _ejbModuleName; 46 47 public EjbJar(EjbConfig config, String ejbModuleName) 48 { 49 _config = config; 50 _ejbModuleName = ejbModuleName; 51 } 52 53 public void setVersion(String version) 54 { 55 } 56 57 public void setSchemaLocation(String value) 58 { 59 } 60 61 public void setDescription(String value) 62 { 63 } 64 65 public void setDisplayName(String value) 66 { 67 } 68 69 public EjbEnterpriseBeans createEnterpriseBeans() 70 throws ConfigException 71 { 72 return new EjbEnterpriseBeans(_config, _ejbModuleName); 73 } 74 75 public Relationships createRelationships() 76 throws ConfigException 77 { 78 return new Relationships(_config); 79 } 80 81 public AssemblyDescriptor createAssemblyDescriptor() 82 throws ConfigException 83 { 84 return new AssemblyDescriptor(_config); 85 } 86 87 public void addQueryFunction(QueryFunction fun) 88 { 89 _config.addFunction(fun.getSignature(), null); 90 } 91 92 public void setBooleanLiteral(BooleanLiteral literal) 93 { 94 _config.setBooleanTrue(literal.getTrue()); 95 _config.setBooleanFalse(literal.getFalse()); 96 } 97 98 public static class Relationships { 99 EjbConfig _config; 100 101 Relationships(EjbConfig config) 102 { 103 _config = config; 104 } 105 106 public CmpRelation createEjbRelation() 107 { 108 return new CmpRelation(_config); 109 } 110 111 public void addEjbRelation(CmpRelation rel) 112 throws ConfigException 113 { 114 _config.addRelation(rel); 115 } 116 } 117 118 public static class AssemblyDescriptor { 119 EjbConfig _config; 120 121 AssemblyDescriptor(EjbConfig config) 122 { 123 _config = config; 124 } 125 126 public ContainerTransaction createContainerTransaction() 127 { 128 return new ContainerTransaction(_config); 129 } 130 131 public MethodPermission createMethodPermission() 132 { 133 return new MethodPermission(_config); 134 } 135 136 public void addSecurityRole(J2eeSecurityRole securityRole) 137 { 138 } 139 } 140 141 public static class QueryFunction { 142 FunctionSignature _sig; 143 String _sql; 144 145 public void setSignature(Signature sig) 146 throws ConfigException 147 { 148 _sig = new FunctionSignature(sig.getSignature()); 149 } 150 151 public FunctionSignature getSignature() 152 { 153 return _sig; 154 } 155 156 public void setSQL(String sql) 157 throws ConfigException 158 { 159 _sql = sql; 160 } 161 162 public String getSQL() 163 { 164 return _sql; 165 } 166 167 @PostConstruct 168 public void init() 169 { 170 _sig.setSQL(_sql); 171 } 172 } 173 174 public static class MethodPermission { 175 EjbConfig _config; 176 177 MethodPermission(EjbConfig config) 178 { 179 _config = config; 180 } 181 182 public void setDescription(String description) 183 { 184 } 185 186 public void setUnchecked(boolean unchecked) 187 { 188 } 189 190 public void setRoleName(String roleName) 191 { 192 } 193 194 public void setMethod(MethodSignature method) 195 { 196 } 197 } 198 } 199 | Popular Tags |