[webbeans-commits] Webbeans SVN: r1966 - in ri/trunk/impl/src/main/java/org/jboss/webbeans: bootstrap and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-03-13 07:12:05 -0400 (Fri, 13 Mar 2009)
New Revision: 1966
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java
Log:
Changes for JIRA issue WBRI-177
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-03-13 11:08:13 UTC (rev 1965)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-03-13 11:12:05 UTC (rev 1966)
@@ -899,12 +899,12 @@
return namingContext;
}
- public EjbResolver getEjbResolver()
+ public final EjbResolver getEjbResolver()
{
return ejbResolver;
}
- public ResourceLoader getResourceLoader()
+ public final ResourceLoader getResourceLoader()
{
return resourceLoader;
}
@@ -915,7 +915,7 @@
*
* @return a TransactionServices provider per the SPI
*/
- public TransactionServices getTransactionServices()
+ public final TransactionServices getTransactionServices()
{
return transactionServices;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-03-13 11:08:13 UTC (rev 1965)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-03-13 11:12:05 UTC (rev 1966)
@@ -83,7 +83,7 @@
}
if (getTransactionServices() == null)
{
- throw new IllegalStateException("TransactionServices is not set");
+ log.info("Transactional services not available. Transactional observers will be invoked synchronously.");
}
this.manager = new ManagerImpl(getNamingContext(), getEjbResolver(), getResourceLoader(), getTransactionServices());
getManager().getNaming().bind(ManagerImpl.JNDI_KEY, getManager());
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java 2009-03-13 11:08:13 UTC (rev 1965)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java 2009-03-13 11:12:05 UTC (rev 1966)
@@ -87,7 +87,7 @@
@Override
public void notify(T event)
{
- if (manager.getTransactionServices().isTransactionActive())
+ if ((manager.getTransactionServices() != null) && (manager.getTransactionServices().isTransactionActive()))
{
deferEvent(event);
}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1965 - in ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd: model and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-03-13 07:08:13 -0400 (Fri, 13 Mar 2009)
New Revision: 1965
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterModel.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterFieldModel.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/DataSetter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java
Log:
Initial hierarchy/overloading support for XSD
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/DataSetter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/DataSetter.java 2009-03-13 10:23:40 UTC (rev 1964)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/DataSetter.java 2009-03-13 11:08:13 UTC (rev 1965)
@@ -7,8 +7,9 @@
import javax.lang.model.element.VariableElement;
import org.jboss.webbeans.xsd.model.ClassModel;
+import org.jboss.webbeans.xsd.model.FieldModel;
import org.jboss.webbeans.xsd.model.MethodModel;
-import org.jboss.webbeans.xsd.model.ParameterFieldModel;
+import org.jboss.webbeans.xsd.model.ParameterModel;
public class DataSetter
{
@@ -33,7 +34,7 @@
}
String name = element.getSimpleName().toString();
String type = element.asType().toString();
- classModel.addField(new ParameterFieldModel(name, type));
+ classModel.addField(new FieldModel(name, type));
}
public static void populateMethodModel(ClassModel classModel, Element element)
@@ -52,7 +53,7 @@
{
String paramName = parameterElement.getSimpleName().toString();
String paramType = parameterElement.asType().toString();
- ParameterFieldModel parameter = new ParameterFieldModel(paramName, paramType);
+ ParameterModel parameter = new ParameterModel(paramName, paramType);
method.addParameter(parameter);
}
if ("<init>".equals(name))
@@ -65,10 +66,4 @@
}
}
- public static String getSimpleNameFromQualifiedName(String qualifiedName)
- {
- int lastDot = qualifiedName.lastIndexOf(".");
- return lastDot < 0 ? qualifiedName : qualifiedName.substring(lastDot);
- }
-
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java 2009-03-13 10:23:40 UTC (rev 1964)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java 2009-03-13 11:08:13 UTC (rev 1965)
@@ -1,13 +1,15 @@
package org.jboss.webbeans.xsd.model;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
public class ClassModel extends NamedModel
{
private ClassModel parent;
- private List<ParameterFieldModel> fields = new ArrayList<ParameterFieldModel>();
+ private List<FieldModel> fields = new ArrayList<FieldModel>();
private List<MethodModel> methods = new ArrayList<MethodModel>();
private List<MethodModel> constructors = new ArrayList<MethodModel>();
@@ -15,7 +17,7 @@
{
}
- public void addField(ParameterFieldModel fieldModel)
+ public void addField(FieldModel fieldModel)
{
fields.add(fieldModel);
}
@@ -63,4 +65,44 @@
return lastDot < 0 ? name : name.substring(lastDot + 1);
}
+ public Set<MethodModel> getMergedConstructors()
+ {
+ return new HashSet<MethodModel>(constructors);
+ }
+
+ public List<FieldModel> getFields()
+ {
+ return fields;
+ }
+
+ public Set<FieldModel> getMergedFields()
+ {
+ Set<FieldModel> mergedFields = new HashSet<FieldModel>(fields);
+ ClassModel currentParent = parent;
+ while (currentParent != null)
+ {
+ mergedFields.addAll(currentParent.getFields());
+ currentParent = currentParent.getParent();
+ }
+ return mergedFields;
+ }
+
+ public List<MethodModel> getMethods()
+ {
+ return methods;
+ }
+
+ public Set<MethodModel> getMergedMethods()
+ {
+ Set<MethodModel> mergedMethods = new HashSet<MethodModel>(methods);
+ ClassModel currentParent = parent;
+ while (currentParent != null)
+ {
+ mergedMethods.addAll(currentParent.getMethods());
+ currentParent = currentParent.getParent();
+ }
+ return mergedMethods;
+
+ }
+
}
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java (from rev 1962, ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterFieldModel.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java 2009-03-13 11:08:13 UTC (rev 1965)
@@ -0,0 +1,31 @@
+package org.jboss.webbeans.xsd.model;
+
+public class FieldModel extends NamedModel
+{
+ protected String type;
+
+ public FieldModel(String name, String type)
+ {
+ super(name);
+ this.type = type;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ FieldModel otherModel = (FieldModel) other;
+ return name.equals(otherModel.getName()) && type.equals(otherModel.getType());
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return name.hashCode() + type.hashCode();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java 2009-03-13 10:23:40 UTC (rev 1964)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java 2009-03-13 11:08:13 UTC (rev 1965)
@@ -6,7 +6,7 @@
public class MethodModel extends NamedModel
{
private String returnType;
- private List<ParameterFieldModel> parameters = new ArrayList<ParameterFieldModel>();
+ private List<ParameterModel> parameters = new ArrayList<ParameterModel>();
public MethodModel(String name, String returnType)
{
@@ -14,12 +14,12 @@
this.returnType = returnType;
}
- public void addParameter(ParameterFieldModel parameter)
+ public void addParameter(ParameterModel parameter)
{
parameters.add(parameter);
}
- public List<ParameterFieldModel> getParameters()
+ public List<ParameterModel> getParameters()
{
return parameters;
}
@@ -29,4 +29,17 @@
return returnType;
}
+ @Override
+ public boolean equals(Object other)
+ {
+ MethodModel otherModel = (MethodModel) other;
+ return name.equals(otherModel.getName()) && returnType.equals(otherModel.getReturnType()) && parameters.equals(otherModel.getParameters());
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return name.hashCode() + returnType.hashCode() + parameters.hashCode();
+ }
+
}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterFieldModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterFieldModel.java 2009-03-13 10:23:40 UTC (rev 1964)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterFieldModel.java 2009-03-13 11:08:13 UTC (rev 1965)
@@ -1,18 +0,0 @@
-package org.jboss.webbeans.xsd.model;
-
-public class ParameterFieldModel extends NamedModel
-{
- private String type;
-
- public ParameterFieldModel(String name, String type)
- {
- super(name);
- this.type = type;
- }
-
- public String getType()
- {
- return type;
- }
-
-}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterModel.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterModel.java 2009-03-13 11:08:13 UTC (rev 1965)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.xsd.model;
+
+public class ParameterModel extends FieldModel
+{
+
+ public ParameterModel(String name, String type)
+ {
+ super(name, type);
+ }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ ParameterModel otherModel = (ParameterModel) other;
+ return type.equals(otherModel.getType());
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return type.hashCode();
+ }
+
+}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1964 - ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-03-13 06:23:40 -0400 (Fri, 13 Mar 2009)
New Revision: 1964
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/AnnotationTest2.java
Log:
oops2
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/AnnotationTest2.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/AnnotationTest2.java 2009-03-13 10:03:06 UTC (rev 1963)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/AnnotationTest2.java 2009-03-13 10:23:40 UTC (rev 1964)
@@ -1,30 +0,0 @@
-package org.jboss.webbeans.xsd;
-
-public class AnnotationTest2 extends AnnotationTest
-{
- public String tar;
- private String xar;
-
- private void hidden() {
- }
-
- public AnnotationTest2(String foo)
- {
- }
-
- public AnnotationTest2() {
- }
-
- public void ping()
- {
- }
-
- public void ping(String foo)
- {
- }
-
- public String foo(String bar)
- {
- return bar;
- }
-}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1963 - ri/trunk/version-matrix.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-03-13 06:03:06 -0400 (Fri, 13 Mar 2009)
New Revision: 1963
Modified:
ri/trunk/version-matrix/pom.xml
Log:
oops, forgot version
Modified: ri/trunk/version-matrix/pom.xml
===================================================================
--- ri/trunk/version-matrix/pom.xml 2009-03-13 09:58:55 UTC (rev 1962)
+++ ri/trunk/version-matrix/pom.xml 2009-03-13 10:03:06 UTC (rev 1963)
@@ -116,6 +116,12 @@
</dependency>
<dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <version>1.6.1</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>1.2</version>
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1962 - in ri/trunk/impl: src/main/java/org/jboss/webbeans and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-03-13 05:58:55 -0400 (Fri, 13 Mar 2009)
New Revision: 1962
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/AnnotationProcessor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/AnnotationTest2.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/DataSetter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterFieldModel.java
Modified:
ri/trunk/impl/pom.xml
ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/PhaseHelper.java
Log:
Start work on package XSD generator
Modified: ri/trunk/impl/pom.xml
===================================================================
--- ri/trunk/impl/pom.xml 2009-03-13 08:33:15 UTC (rev 1961)
+++ ri/trunk/impl/pom.xml 2009-03-13 09:58:55 UTC (rev 1962)
@@ -89,6 +89,11 @@
</dependency>
<dependency>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<optional>true</optional>
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/PhaseHelper.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/PhaseHelper.java 2009-03-13 08:33:15 UTC (rev 1961)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/PhaseHelper.java 2009-03-13 09:58:55 UTC (rev 1962)
@@ -35,7 +35,7 @@
{
private static LogProvider log = Logging.getLogProvider(PhaseHelper.class);
- private static final String CONVERSATION_PROPAGATION_KEY = "webbeans_conversation_propagationz";
+ private static final String CONVERSATION_PROPAGATION_KEY = "webbeans_conversation_propagation";
/**
* Gets a FacesContext instance
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/AnnotationProcessor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/AnnotationProcessor.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/AnnotationProcessor.java 2009-03-13 09:58:55 UTC (rev 1962)
@@ -0,0 +1,119 @@
+package org.jboss.webbeans.xsd;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.annotation.processing.AbstractProcessor;
+import javax.annotation.processing.RoundEnvironment;
+import javax.annotation.processing.SupportedAnnotationTypes;
+import javax.annotation.processing.SupportedSourceVersion;
+import javax.lang.model.SourceVersion;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.type.DeclaredType;
+import javax.lang.model.type.TypeKind;
+import javax.lang.model.util.ElementFilter;
+
+import org.dom4j.Document;
+import org.dom4j.DocumentHelper;
+import org.dom4j.Namespace;
+import org.dom4j.QName;
+import org.jboss.webbeans.xsd.model.ClassModel;
+
+(a)SupportedSourceVersion(SourceVersion.RELEASE_6)
+@SupportedAnnotationTypes("*")
+public class AnnotationProcessor extends AbstractProcessor
+{
+ private Map<String, ClassModel> classModelCache = new HashMap<String, ClassModel>();
+ private Map<String, Document> packageXSDs = new HashMap<String, Document>();
+ private List<ClassModel> workingSet = new ArrayList<ClassModel>();
+
+ @Override
+ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
+ {
+ for (Element element : roundEnv.getRootElements())
+ {
+ workingSet.add(inspectClass(element));
+ }
+ if (roundEnv.processingOver())
+ {
+ writeXSD();
+ }
+ return true;
+ }
+
+ private Document getPackageXSD(String packageName)
+ {
+ Document packageXSD = packageXSDs.get(packageName);
+ if (packageXSD == null)
+ {
+ packageXSD = initPackageXSD(packageName);
+ packageXSDs.put(packageName, packageXSD);
+ }
+ return packageXSD;
+ }
+
+ private String getShortName(String packageName)
+ {
+ int lastDot = packageName.lastIndexOf(".");
+ return lastDot < 0 ? packageName : packageName.substring(lastDot + 1);
+ }
+
+ private Document initPackageXSD(String packageName)
+ {
+ Document packageXSD = DocumentHelper.createDocument();
+
+ packageXSD.addElement(new QName("Package", new Namespace(getShortName(packageName), "urn:java:" + packageName)));
+ return packageXSD;
+ }
+
+ private void writeXSD()
+ {
+ for (ClassModel classModel : workingSet)
+ {
+ Document packageXSD = getPackageXSD(classModel.getPackage());
+ addClass(packageXSD, classModel);
+ }
+ for (Document document : packageXSDs.values())
+ {
+ System.out.println(document.asXML());
+ }
+ }
+
+ private void addClass(Document packageXSD, ClassModel classModel)
+ {
+ packageXSD.getRootElement().addElement(classModel.getSimpleName());
+ }
+
+ private ClassModel inspectClass(Element element)
+ {
+ TypeElement typeElement = (TypeElement) element;
+ ClassModel classModel = new ClassModel();
+
+ if (typeElement.getSuperclass().getKind() != TypeKind.NONE)
+ {
+ inspectClass(((DeclaredType) typeElement.getSuperclass()).asElement());
+ }
+
+ ClassModel parent = classModelCache.get(typeElement.getSuperclass().toString());
+ DataSetter.populateClassModel(classModel, element, parent);
+ for (Element field : ElementFilter.fieldsIn(element.getEnclosedElements()))
+ {
+ DataSetter.populateFieldModel(classModel, field);
+ }
+ for (Element method : ElementFilter.methodsIn(element.getEnclosedElements()))
+ {
+ DataSetter.populateMethodModel(classModel, method);
+ }
+ for (Element constructor : ElementFilter.constructorsIn(element.getEnclosedElements()))
+ {
+ DataSetter.populateMethodModel(classModel, constructor);
+ }
+ classModelCache.put(classModel.getName(), classModel);
+ return classModel;
+ }
+
+}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/AnnotationTest2.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/AnnotationTest2.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/AnnotationTest2.java 2009-03-13 09:58:55 UTC (rev 1962)
@@ -0,0 +1,30 @@
+package org.jboss.webbeans.xsd;
+
+public class AnnotationTest2 extends AnnotationTest
+{
+ public String tar;
+ private String xar;
+
+ private void hidden() {
+ }
+
+ public AnnotationTest2(String foo)
+ {
+ }
+
+ public AnnotationTest2() {
+ }
+
+ public void ping()
+ {
+ }
+
+ public void ping(String foo)
+ {
+ }
+
+ public String foo(String bar)
+ {
+ return bar;
+ }
+}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/DataSetter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/DataSetter.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/DataSetter.java 2009-03-13 09:58:55 UTC (rev 1962)
@@ -0,0 +1,74 @@
+package org.jboss.webbeans.xsd;
+
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ExecutableElement;
+import javax.lang.model.element.Modifier;
+import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.VariableElement;
+
+import org.jboss.webbeans.xsd.model.ClassModel;
+import org.jboss.webbeans.xsd.model.MethodModel;
+import org.jboss.webbeans.xsd.model.ParameterFieldModel;
+
+public class DataSetter
+{
+
+ private static boolean isPublic(Element element)
+ {
+ return element.getModifiers().contains(Modifier.PUBLIC);
+ }
+
+ public static void populateClassModel(ClassModel classModel, Element element, ClassModel parent)
+ {
+ TypeElement typeElement = (TypeElement) element;
+ classModel.setName(typeElement.getQualifiedName().toString());
+ classModel.setParent(parent);
+ }
+
+ public static void populateFieldModel(ClassModel classModel, Element element)
+ {
+ if (!isPublic(element))
+ {
+ return;
+ }
+ String name = element.getSimpleName().toString();
+ String type = element.asType().toString();
+ classModel.addField(new ParameterFieldModel(name, type));
+ }
+
+ public static void populateMethodModel(ClassModel classModel, Element element)
+ {
+ if (!isPublic(element))
+ {
+ return;
+ }
+ ExecutableElement executableElement = (ExecutableElement) element;
+
+ String name = element.getSimpleName().toString();
+ String returnType = executableElement.getReturnType().toString();
+ MethodModel method = new MethodModel(name, returnType);
+
+ for (VariableElement parameterElement : executableElement.getParameters())
+ {
+ String paramName = parameterElement.getSimpleName().toString();
+ String paramType = parameterElement.asType().toString();
+ ParameterFieldModel parameter = new ParameterFieldModel(paramName, paramType);
+ method.addParameter(parameter);
+ }
+ if ("<init>".equals(name))
+ {
+ classModel.addConstructor(method);
+ }
+ else
+ {
+ classModel.addMethod(method);
+ }
+ }
+
+ public static String getSimpleNameFromQualifiedName(String qualifiedName)
+ {
+ int lastDot = qualifiedName.lastIndexOf(".");
+ return lastDot < 0 ? qualifiedName : qualifiedName.substring(lastDot);
+ }
+
+}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java 2009-03-13 09:58:55 UTC (rev 1962)
@@ -0,0 +1,66 @@
+package org.jboss.webbeans.xsd.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ClassModel extends NamedModel
+{
+ private ClassModel parent;
+
+ private List<ParameterFieldModel> fields = new ArrayList<ParameterFieldModel>();
+ private List<MethodModel> methods = new ArrayList<MethodModel>();
+ private List<MethodModel> constructors = new ArrayList<MethodModel>();
+
+ public ClassModel()
+ {
+ }
+
+ public void addField(ParameterFieldModel fieldModel)
+ {
+ fields.add(fieldModel);
+ }
+
+ public void addConstructor(MethodModel constructorModel)
+ {
+ constructors.add(constructorModel);
+ }
+
+ public void addMethod(MethodModel methodModel)
+ {
+ methods.add(methodModel);
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("Name: " + name + "\n");
+ buffer.append("Constructors: " + constructors + "\n");
+ buffer.append("Methods: " + methods + "\n");
+ buffer.append("Fields: " + fields + "\n");
+ return buffer.toString();
+ }
+
+ public ClassModel getParent()
+ {
+ return parent;
+ }
+
+ public void setParent(ClassModel parent)
+ {
+ this.parent = parent;
+ }
+
+ public String getPackage()
+ {
+ int lastDot = name.lastIndexOf(".");
+ return lastDot < 0 ? name : name.substring(0, lastDot);
+ }
+
+ public String getSimpleName()
+ {
+ int lastDot = name.lastIndexOf(".");
+ return lastDot < 0 ? name : name.substring(lastDot + 1);
+ }
+
+}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java 2009-03-13 09:58:55 UTC (rev 1962)
@@ -0,0 +1,32 @@
+package org.jboss.webbeans.xsd.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MethodModel extends NamedModel
+{
+ private String returnType;
+ private List<ParameterFieldModel> parameters = new ArrayList<ParameterFieldModel>();
+
+ public MethodModel(String name, String returnType)
+ {
+ super(name);
+ this.returnType = returnType;
+ }
+
+ public void addParameter(ParameterFieldModel parameter)
+ {
+ parameters.add(parameter);
+ }
+
+ public List<ParameterFieldModel> getParameters()
+ {
+ return parameters;
+ }
+
+ public String getReturnType()
+ {
+ return returnType;
+ }
+
+}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java 2009-03-13 09:58:55 UTC (rev 1962)
@@ -0,0 +1,25 @@
+package org.jboss.webbeans.xsd.model;
+
+public class NamedModel
+{
+ protected String name;
+
+ public NamedModel()
+ {
+ }
+
+ public NamedModel(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterFieldModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterFieldModel.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterFieldModel.java 2009-03-13 09:58:55 UTC (rev 1962)
@@ -0,0 +1,18 @@
+package org.jboss.webbeans.xsd.model;
+
+public class ParameterFieldModel extends NamedModel
+{
+ private String type;
+
+ public ParameterFieldModel(String name, String type)
+ {
+ super(name);
+ this.type = type;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+}
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1961 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-03-13 04:33:15 -0400 (Fri, 13 Mar 2009)
New Revision: 1961
Modified:
doc/trunk/reference/zh-CN/specialization.po
Log:
simplified chinese of specialization section is finished.
Modified: doc/trunk/reference/zh-CN/specialization.po
===================================================================
--- doc/trunk/reference/zh-CN/specialization.po 2009-03-13 08:05:10 UTC (rev 1960)
+++ doc/trunk/reference/zh-CN/specialization.po 2009-03-13 08:33:15 UTC (rev 1961)
@@ -3,11 +3,11 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: master.xml \n"
+"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-04 23:18+0000\n"
-"PO-Revision-Date: 2008-12-19 20:26+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2009-03-13 16:32+0800\n"
+"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,17 +17,13 @@
#: specialization.xml:4
#, no-c-format
msgid "Specialization"
-msgstr ""
+msgstr "特化"
#. Tag: para
#: specialization.xml:6
#, no-c-format
-msgid ""
-"We've already seen how the Web Beans dependency injection model lets us "
-"<emphasis>override</emphasis> the implementation of an API at deployment "
-"time. For example, the following enterprise Web Bean provides an "
-"implementation of the API <literal>PaymentProcessor</literal> in production:"
-msgstr ""
+msgid "We've already seen how the Web Beans dependency injection model lets us <emphasis>override</emphasis> the implementation of an API at deployment time. For example, the following enterprise Web Bean provides an implementation of the API <literal>PaymentProcessor</literal> in production:"
+msgstr "我们已经看到Web Bean的依赖注入模型如何让我们在部署时期 <emphasis>重载</emphasis> 一个API实现。例如,下面的企业级Web Bean在生产环境下使提供一个<literal>PaymentProcessor</literal>接口的实现:"
#. Tag: programlisting
#: specialization.xml:11
@@ -39,14 +35,17 @@
" ...\n"
"}"
msgstr ""
+"@CreditCard @Stateless\n"
+"public class CreditCardPaymentProcessor \n"
+" implements PaymentProcessor {\n"
+" ...\n"
+"}"
#. Tag: para
#: specialization.xml:13
#, no-c-format
-msgid ""
-"But in our staging environment, we override that implementation of "
-"<literal>PaymentProcessor</literal> with a different Web Bean:"
-msgstr ""
+msgid "But in our staging environment, we override that implementation of <literal>PaymentProcessor</literal> with a different Web Bean:"
+msgstr "但在我们的阶段开发环境中,我们可以使用一个不同的Web Bean来重载这个<literal>PaymentProcessor</literal> 实现:"
#. Tag: programlisting
#: specialization.xml:16
@@ -58,124 +57,101 @@
" ...\n"
"}"
msgstr ""
+"@CreditCard @Stateless @Staging\n"
+"public class StagingCreditCardPaymentProcessor \n"
+" implements PaymentProcessor {\n"
+" ...\n"
+"}"
#. Tag: para
#: specialization.xml:18
#, no-c-format
-msgid ""
-"What we've tried to do with <literal>StagingCreditCardPaymentProcessor</"
-"literal> is to completely replace <literal>AsyncPaymentProcessor</literal> "
-"in a particular deployment of the system. In that deployment, the deployment "
-"type <literal>@Staging</literal> would have a higher priority than the "
-"default deployment type <literal>@Production</literal>, and therefore "
-"clients with the following injection point:"
-msgstr ""
+msgid "What we've tried to do with <literal>StagingCreditCardPaymentProcessor</literal> is to completely replace <literal>AsyncPaymentProcessor</literal> in a particular deployment of the system. In that deployment, the deployment type <literal>@Staging</literal> would have a higher priority than the default deployment type <literal>@Production</literal>, and therefore clients with the following injection point:"
+msgstr "我们试图做的是在特定的系统部署环境中使用<literal>StagingCreditCardPaymentProcessor</literal>来完全替代<literal>AsyncPaymentProcessor</literal>。在这个部署中,部署类型为<literal>@Staging</literal>的将有比默认部署类型<literal>@Production</literal>更高的优先级,因此下面注入点的客户:"
#. Tag: programlisting
#: specialization.xml:24
#, no-c-format
msgid "@CreditCard PaymentProcessor ccpp"
-msgstr ""
+msgstr "@CreditCard PaymentProcessor ccpp"
#. Tag: para
#: specialization.xml:26
#, no-c-format
-msgid ""
-"Would receive an instance of <literal>StagingCreditCardPaymentProcessor</"
-"literal>."
-msgstr ""
+msgid "Would receive an instance of <literal>StagingCreditCardPaymentProcessor</literal>."
+msgstr "将会收到一个 <literal>StagingCreditCardPaymentProcessor</literal> 的实例。"
#. Tag: para
#: specialization.xml:28
#, no-c-format
msgid "Unfortunately, there are several traps we can easily fall into:"
-msgstr ""
+msgstr "不幸的是,我们很容易掉入几个陷阱:"
#. Tag: para
#: specialization.xml:32
#, no-c-format
-msgid ""
-"the higher-priority Web Bean may not implement all the API types of the Web "
-"Bean that it attempts to override,"
-msgstr ""
+msgid "the higher-priority Web Bean may not implement all the API types of the Web Bean that it attempts to override,"
+msgstr "更高优先级的Web Bean可能没有实现其要重载的所有的API类型,"
#. Tag: para
#: specialization.xml:36
#, no-c-format
-msgid ""
-"the higher-priority Web Bean may not declare all the binding types of the "
-"Web Bean that it attempts to override,"
-msgstr ""
+msgid "the higher-priority Web Bean may not declare all the binding types of the Web Bean that it attempts to override,"
+msgstr "更高优先级的Web Bean可能没有声明其要重载的所有绑定类型,"
#. Tag: para
#: specialization.xml:40
#, no-c-format
-msgid ""
-"the higher-priority Web Bean might not have the same name as the Web Bean "
-"that it attempts to override, or"
-msgstr ""
+msgid "the higher-priority Web Bean might not have the same name as the Web Bean that it attempts to override, or"
+msgstr "更高优先级的Web Bean可能没有和其要重载的Web Bean拥有相同的名字,或者"
#. Tag: para
#: specialization.xml:44
#, no-c-format
-msgid ""
-"the Web Bean that it attempts to override might declare a producer method, "
-"disposal method or observer method."
-msgstr ""
+msgid "the Web Bean that it attempts to override might declare a producer method, disposal method or observer method."
+msgstr "其要重载的Web Bean有可能声明了一个生产者方法,清除方法或者观察者方法。"
#. Tag: para
#: specialization.xml:49
#, no-c-format
-msgid ""
-"In each of these cases, the Web Bean that we tried to override could still "
-"be called at runtime. Therefore, overriding is somewhat prone to developer "
-"error."
-msgstr ""
+msgid "In each of these cases, the Web Bean that we tried to override could still be called at runtime. Therefore, overriding is somewhat prone to developer error."
+msgstr "在上面的任何一种情况,我们试图重载的Web Bean仍旧可以在运行时被调用。因此重载对于开发者来说是很容易出错的。"
#. Tag: para
#: specialization.xml:52
#, no-c-format
-msgid ""
-"Web Beans provides a special feature, called <emphasis>specialization</"
-"emphasis>, that helps the developer avoid these traps. Specialization looks "
-"a little esoteric at first, but it's easy to use in practice, and you'll "
-"really appreciate the extra security it provides."
-msgstr ""
+msgid "Web Beans provides a special feature, called <emphasis>specialization</emphasis>, that helps the developer avoid these traps. Specialization looks a little esoteric at first, but it's easy to use in practice, and you'll really appreciate the extra security it provides."
+msgstr "Web Bean提供了一个特殊的特性,称之为<emphasis>特化</emphasis>,能够帮助开发者避免这些陷阱。特化初看起来有些神秘,但是在实际应用中非常容易使用,你很快就会感激它提供的特殊的安全性。"
#. Tag: title
#: specialization.xml:58
#, no-c-format
msgid "Using specialization"
-msgstr ""
+msgstr "使用特化"
#. Tag: para
#: specialization.xml:60
#, no-c-format
-msgid ""
-"Specialization is a feature that is specific to simple and enterprise Web "
-"Beans. To make use of specialization, the higher-priority Web Bean must:"
-msgstr ""
+msgid "Specialization is a feature that is specific to simple and enterprise Web Beans. To make use of specialization, the higher-priority Web Bean must:"
+msgstr "特化是为简单和企业级Web Bean提供的特性。要使用特化,更高优先级的Web Bean必须:"
#. Tag: para
#: specialization.xml:65
#, no-c-format
msgid "be a direct subclass of the Web Bean it overrides, and"
-msgstr ""
+msgstr "是其重载的Web Bean的直接子类,并且"
#. Tag: para
#: specialization.xml:68
#, no-c-format
-msgid ""
-"be a simple Web Bean if the Web Bean it overrides is a simple Web Bean or an "
-"enterprise Web Bean if the Web Bean it overrides is an enterprise Web Bean, "
-"and"
-msgstr ""
+msgid "be a simple Web Bean if the Web Bean it overrides is a simple Web Bean or an enterprise Web Bean if the Web Bean it overrides is an enterprise Web Bean, and"
+msgstr "如果其重载的是简单的Web Bean, 它也要是一个简单的Web Bean;如果其重载的是企业级的Web Bean, 它也要是一个企业级的Web Bean,并且"
#. Tag: para
#: specialization.xml:73
#, no-c-format
msgid "be annotated <literal>@Specializes</literal>."
-msgstr ""
+msgstr "需要使用 <literal>@Specializes</literal> 注释。"
#. Tag: programlisting
#: specialization.xml:77
@@ -187,105 +163,87 @@
" ...\n"
"}"
msgstr ""
+"@Stateless @Staging @Specializes\n"
+"public class StagingCreditCardPaymentProcessor \n"
+" extends CreditCardPaymentProcessor {\n"
+" ...\n"
+"}"
#. Tag: para
#: specialization.xml:79
#, no-c-format
-msgid ""
-"We say that the higher-priority Web Bean <emphasis>specializes</emphasis> "
-"its superclass."
-msgstr ""
+msgid "We say that the higher-priority Web Bean <emphasis>specializes</emphasis> its superclass."
+msgstr "我们称更高优先级的Web Bean<emphasis>特化</emphasis>了它的超类。"
#. Tag: title
#: specialization.xml:85
#, no-c-format
msgid "Advantages of specialization"
-msgstr ""
+msgstr "特化的优点"
#. Tag: para
#: specialization.xml:87
#, no-c-format
msgid "When specialization is used:"
-msgstr ""
+msgstr "当使用特化时:"
#. Tag: para
#: specialization.xml:91
#, no-c-format
-msgid ""
-"the binding types of the superclass are automatically inherited by the Web "
-"Bean annotated <literal>@Specializes</literal>, and"
-msgstr ""
+msgid "the binding types of the superclass are automatically inherited by the Web Bean annotated <literal>@Specializes</literal>, and"
+msgstr "超类的绑定类型自动被使用<literal>@Specializes</literal>注释的Web Bean继承,并且"
#. Tag: para
#: specialization.xml:95
#, no-c-format
-msgid ""
-"the Web Bean name of the superclass is automatically inherited by the Web "
-"Bean annotated <literal>@Specializes</literal>, and"
-msgstr ""
+msgid "the Web Bean name of the superclass is automatically inherited by the Web Bean annotated <literal>@Specializes</literal>, and"
+msgstr "超类的Web Bean名称自动被使用<literal>@Specializes</literal>注释的Web Bean继承,并且"
#. Tag: para
#: specialization.xml:99
#, no-c-format
-msgid ""
-"producer methods, disposal methods and observer methods declared by the "
-"superclass are called upon an instance of the Web Bean annotated "
-"<literal>@Specializes</literal>."
-msgstr ""
+msgid "producer methods, disposal methods and observer methods declared by the superclass are called upon an instance of the Web Bean annotated <literal>@Specializes</literal>."
+msgstr "超类声明的生产者方法,清除方法和观察者方法将在使用<literal>@Specializes</literal>注释的Web Bean实例上调用。"
#. Tag: para
#: specialization.xml:105
#, no-c-format
-msgid ""
-"In our example, the binding type <literal>@CreditCard</literal> of "
-"<literal>CreditCardPaymentProcessor</literal> is inherited by "
-"<literal>StagingCreditCardPaymentProcessor</literal>."
-msgstr ""
+msgid "In our example, the binding type <literal>@CreditCard</literal> of <literal>CreditCardPaymentProcessor</literal> is inherited by <literal>StagingCreditCardPaymentProcessor</literal>."
+msgstr "在我们这个例子中,<literal>CreditCardPaymentProcessor</literal> 的绑定类型 <literal>@CreditCard</literal> 被<literal>StagingCreditCardPaymentProcessor</literal>继承。"
#. Tag: para
#: specialization.xml:109
#, no-c-format
msgid "Furthermore, the Web Bean manager will validate that:"
-msgstr ""
+msgstr "进一步,Web Bean管理器将验证:"
#. Tag: para
#: specialization.xml:113
#, no-c-format
-msgid ""
-"all API types of the superclass are API types of the Web Bean annotated "
-"<literal>@Specializes</literal> (all local interfaces of the superclass "
-"enterprise bean are also local interfaces of the subclass),"
-msgstr ""
+msgid "all API types of the superclass are API types of the Web Bean annotated <literal>@Specializes</literal> (all local interfaces of the superclass enterprise bean are also local interfaces of the subclass),"
+msgstr "超类的所有API类型是使用 <literal>@Specializes</literal> 注释的Web Bean的API类型(所有企业级Bean超类的本地接口是子类的本地接口)"
#. Tag: para
#: specialization.xml:119
#, no-c-format
-msgid ""
-"the deployment type of the Web Bean annotated <literal>@Specializes</"
-"literal> has a higher precedence than the deployment type of the superclass, "
-"and"
-msgstr ""
+msgid "the deployment type of the Web Bean annotated <literal>@Specializes</literal> has a higher precedence than the deployment type of the superclass, and"
+msgstr "使用 <literal>@Specializes</literal> 注释的Web Bean的部署类型比超类的部署类型拥有更高的优先级,并且"
#. Tag: para
#: specialization.xml:124
#, no-c-format
-msgid ""
-"there is no other enabled Web Bean that also specializes the superclass."
-msgstr ""
+msgid "there is no other enabled Web Bean that also specializes the superclass."
+msgstr "没有其他特化该超类的Web Bean被激活。"
#. Tag: para
#: specialization.xml:129
#, no-c-format
-msgid ""
-"If any of these conditions are violated, the Web Bean manager throws an "
-"exception at initialization time."
-msgstr ""
+msgid "If any of these conditions are violated, the Web Bean manager throws an exception at initialization time."
+msgstr "如果任何一条有冲突的话,Web Bean管理器将在初始化时抛出一个异常。"
#. Tag: para
#: specialization.xml:132
#, no-c-format
-msgid ""
-"Therefore, we can be certain that the superclass will <emphasis>never</"
-"emphasis> be called in any deployment of the system where the Web Bean "
-"annotated <literal>@Specializes</literal> is deployed and enabled."
-msgstr ""
+msgid "Therefore, we can be certain that the superclass will <emphasis>never</emphasis> be called in any deployment of the system where the Web Bean annotated <literal>@Specializes</literal> is deployed and enabled."
+msgstr "因此,我们可以确定当使用<literal>@Specializes</literal>注释的Web Bean被部署和激活时,超类在系统的任何部署中<emphasis>都不会</emphasis>被调用。"
+
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1960 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-03-13 04:05:10 -0400 (Fri, 13 Mar 2009)
New Revision: 1960
Modified:
doc/trunk/reference/zh-CN/stereotypes.po
Log:
simplified chinese translation of stereotype section is finished
Modified: doc/trunk/reference/zh-CN/stereotypes.po
===================================================================
--- doc/trunk/reference/zh-CN/stereotypes.po 2009-03-13 07:36:41 UTC (rev 1959)
+++ doc/trunk/reference/zh-CN/stereotypes.po 2009-03-13 08:05:10 UTC (rev 1960)
@@ -3,11 +3,11 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: master.xml \n"
+"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-19 20:26+0000\n"
-"PO-Revision-Date: 2008-12-19 20:26+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2009-03-13 16:04+0800\n"
+"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,81 +17,73 @@
#: stereotypes.xml:4
#, no-c-format
msgid "Stereotypes"
-msgstr ""
+msgstr "模板"
#. Tag: para
#: stereotypes.xml:6
#, no-c-format
msgid "According to the Web Beans specification:"
-msgstr ""
+msgstr "根据Web Bean规范:"
#. Tag: para
#: stereotypes.xml:10
#, no-c-format
-msgid ""
-"In many systems, use of architectural patterns produces a set of recurring "
-"Web Bean roles. A stereotype allows a framework developer to identify such a "
-"role and declare some common metadata for Web Beans with that role in a "
-"central place."
-msgstr ""
+msgid "In many systems, use of architectural patterns produces a set of recurring Web Bean roles. A stereotype allows a framework developer to identify such a role and declare some common metadata for Web Beans with that role in a central place."
+msgstr "在很多系统中,体系模式的使用会产生一套重复发生的Web Bean角色。一个模板允许一个框架开发者来识别这样的一个角色,并且在一个中心地方为拥有这个角色的Web Bean声明一些通用的元数据。"
#. Tag: para
#: stereotypes.xml:14
#, no-c-format
msgid "A stereotype encapsulates any combination of:"
-msgstr ""
+msgstr "一个模板封装了下面的任何组合:"
#. Tag: para
#: stereotypes.xml:18
#, no-c-format
msgid "a default deployment type,"
-msgstr ""
+msgstr "一个默认的部署类型,"
#. Tag: para
#: stereotypes.xml:21
#, no-c-format
msgid "a default scope type,"
-msgstr ""
+msgstr "一个默认的范围类型,"
#. Tag: para
#: stereotypes.xml:24
#, no-c-format
msgid "a restriction upon the Web Bean scope,"
-msgstr ""
+msgstr "一个对于Web Bean范围的限制"
#. Tag: para
#: stereotypes.xml:27
#, no-c-format
msgid "a requirement that the Web Bean implement or extend a certain type, and"
-msgstr ""
+msgstr "一个Web Bean实现或者继承一个特定类型的需求,以及"
#. Tag: para
#: stereotypes.xml:30
#, no-c-format
msgid "a set of interceptor binding annotations."
-msgstr ""
+msgstr "一套拦截器绑定注释。"
#. Tag: para
#: stereotypes.xml:34
#, no-c-format
-msgid ""
-"A stereotype may also specify that all Web Beans with the stereotype have "
-"defaulted Web Bean names."
-msgstr ""
+msgid "A stereotype may also specify that all Web Beans with the stereotype have defaulted Web Bean names."
+msgstr "一个模板也可以指定所有使用这个模板的Web Bean拥有的默认的Web Bean名称。"
#. Tag: para
#: stereotypes.xml:37
#, no-c-format
msgid "A Web Bean may declare zero, one or multiple stereotypes."
-msgstr ""
+msgstr "一个Web Bean可以声明零个,一个或者多个模板。"
#. Tag: para
#: stereotypes.xml:41
#, no-c-format
-msgid ""
-"A stereotype is a Java annotation type. This stereotype identifies action "
-"classes in some MVC framework:"
-msgstr ""
+msgid "A stereotype is a Java annotation type. This stereotype identifies action classes in some MVC framework:"
+msgstr "一个模板其实就是一个Java注释类型。这个模板在一些MVC框架中识别动作类:"
#. Tag: programlisting
#: stereotypes.xml:44
@@ -102,12 +94,16 @@
"@Stereotype\n"
"public @interface Action {}]]>"
msgstr ""
+"<![CDATA[@Retention(RUNTIME)\n"
+"@Target(TYPE)\n"
+"@Stereotype\n"
+"public @interface Action {}]]>"
#. Tag: para
#: stereotypes.xml:46
#, no-c-format
msgid "We use the stereotype by applying the annotation to a Web Bean."
-msgstr ""
+msgstr "我们注释来让Web Bean应用模板"
#. Tag: programlisting
#: stereotypes.xml:48
@@ -116,23 +112,20 @@
"<![CDATA[@Action \n"
"public class LoginAction { ... }]]>"
msgstr ""
+"<![CDATA[@Action \n"
+"public class LoginAction { ... }]]>"
#. Tag: title
#: stereotypes.xml:51
#, no-c-format
msgid "Default scope and deployment type for a stereotype"
-msgstr ""
+msgstr "一个模板默认的范围和部署类型"
#. Tag: para
#: stereotypes.xml:53
#, no-c-format
-msgid ""
-"A stereotype may specify a default scope and/or default deployment type for "
-"Web Beans with that stereotype. For example, if the deployment type "
-"<literal>@WebTier</literal> identifies Web Beans that should only be "
-"deployed when the system executes as a web application, we might specify the "
-"following defaults for action classes:"
-msgstr ""
+msgid "A stereotype may specify a default scope and/or default deployment type for Web Beans with that stereotype. For example, if the deployment type <literal>@WebTier</literal> identifies Web Beans that should only be deployed when the system executes as a web application, we might specify the following defaults for action classes:"
+msgstr "一个模板可以为使用该模板的Web Bean指定一个默认的范围或者默认的部署类型。例如,如果<literal>@WebTier</literal> 部署类型识别那些只应该在系统作为一个Web应用运行时才应该部署的Web Bean,我们可以为动作类指定下面的默认值:"
#. Tag: programlisting
#: stereotypes.xml:59
@@ -145,14 +138,18 @@
"@Stereotype\n"
"public @interface Action {}]]>"
msgstr ""
+"<![CDATA[@Retention(RUNTIME)\n"
+"@Target(TYPE)\n"
+"@RequestScoped\n"
+"@WebTier\n"
+"@Stereotype\n"
+"public @interface Action {}]]>"
#. Tag: para
#: stereotypes.xml:61
#, no-c-format
-msgid ""
-"Of course, a particular action may still override these defaults if "
-"necessary:"
-msgstr ""
+msgid "Of course, a particular action may still override these defaults if necessary:"
+msgstr "当然,如果必要的话,一个特殊的动作类仍旧可以重载这些默认值:"
#. Tag: programlisting
#: stereotypes.xml:64
@@ -161,28 +158,26 @@
"<![CDATA[@Dependent @Mock @Action \n"
"public class MockLoginAction { ... }]]>"
msgstr ""
+"<![CDATA[@Dependent @Mock @Action \n"
+"public class MockLoginAction { ... }]]>"
#. Tag: para
#: stereotypes.xml:66
#, no-c-format
-msgid ""
-"If we want to force all actions to a particular scope, we can do that too."
-msgstr ""
+msgid "If we want to force all actions to a particular scope, we can do that too."
+msgstr "如果我们想要敬爱那个所有动作类强制在某个特殊的范围,我们也可以这样做。"
#. Tag: title
#: stereotypes.xml:72
#, no-c-format
msgid "Restricting scope and type with a stereotype"
-msgstr ""
+msgstr "通过模板来限制范围和类型"
#. Tag: para
#: stereotypes.xml:74
#, no-c-format
-msgid ""
-"Suppose that we wish to prevent actions from declaring certain scopes. Web "
-"Beans lets us explicitly specify the set of allowed scopes for Web Beans "
-"with a certain stereotype. For example:"
-msgstr ""
+msgid "Suppose that we wish to prevent actions from declaring certain scopes. Web Beans lets us explicitly specify the set of allowed scopes for Web Beans with a certain stereotype. For example:"
+msgstr "假定我们希望那个通过特定的范围声明来阻止一个动作。Web Bean可以让我们显式地为使用特定模板的Web Bean指定一套允许的范围。例如:"
#. Tag: programlisting
#: stereotypes.xml:78
@@ -195,23 +190,24 @@
"@Stereotype(supportedScopes=RequestScoped.class)\n"
"public @interface Action {}]]>"
msgstr ""
+"<![CDATA[@Retention(RUNTIME)\n"
+"@Target(TYPE)\n"
+"@RequestScoped\n"
+"@WebTier\n"
+"@Stereotype(supportedScopes=RequestScoped.class)\n"
+"public @interface Action {}]]>"
#. Tag: para
#: stereotypes.xml:80
#, no-c-format
-msgid ""
-"If a particular action class attempts to specify a scope other than the Web "
-"Beans request scope, an exception will be thrown by the Web Bean manager at "
-"initialization time."
-msgstr ""
+msgid "If a particular action class attempts to specify a scope other than the Web Beans request scope, an exception will be thrown by the Web Bean manager at initialization time."
+msgstr "如果一个特殊的动作类试图指定超越Web Bean请求范围的范围,Web Bean管理器在初始化时就会抛出一个异常。"
#. Tag: para
#: stereotypes.xml:84
#, no-c-format
-msgid ""
-"We can also force all Web Bean with a certain stereotype to implement an "
-"interface or extend a class:"
-msgstr ""
+msgid "We can also force all Web Bean with a certain stereotype to implement an interface or extend a class:"
+msgstr "我们也可以强制所有的使用特定模板的Web Bean实现一个接口或者继承一个类:"
#. Tag: programlisting
#: stereotypes.xml:87
@@ -224,29 +220,30 @@
"@Stereotype(requiredTypes=AbstractAction.class)\n"
"public @interface Action {}]]>"
msgstr ""
+"<![CDATA[@Retention(RUNTIME)\n"
+"@Target(TYPE)\n"
+"@RequestScoped\n"
+"@WebTier\n"
+"@Stereotype(requiredTypes=AbstractAction.class)\n"
+"public @interface Action {}]]>"
#. Tag: para
#: stereotypes.xml:89
#, no-c-format
-msgid ""
-"If a particular action class does not extend the class "
-"<literal>AbstractAction</literal>, an exception will be thrown by the Web "
-"Bean manager at initialization time."
-msgstr ""
+msgid "If a particular action class does not extend the class <literal>AbstractAction</literal>, an exception will be thrown by the Web Bean manager at initialization time."
+msgstr "如果一个特殊的动作类没有继承 <literal>AbstractAction</literal>,Web Bean管理器会在初始化时抛出一个异常。"
#. Tag: title
#: stereotypes.xml:96
#, no-c-format
msgid "Interceptor bindings for stereotypes"
-msgstr ""
+msgstr "模板的拦截器绑定"
#. Tag: para
#: stereotypes.xml:98
#, no-c-format
-msgid ""
-"A stereotype may specify a set of interceptor bindings to be inherited by "
-"all Web Beans with that stereotype."
-msgstr ""
+msgid "A stereotype may specify a set of interceptor bindings to be inherited by all Web Beans with that stereotype."
+msgstr "一个模板指定一套拦截器绑定让使用该模板的Web Bean继承。"
#. Tag: programlisting
#: stereotypes.xml:101
@@ -261,30 +258,32 @@
"@Stereotype\n"
"public @interface Action {}]]>"
msgstr ""
+"<![CDATA[@Retention(RUNTIME)\n"
+"@Target(TYPE)\n"
+"@RequestScoped\n"
+"@Transactional(requiresNew=true)\n"
+"@Secure\n"
+"@WebTier\n"
+"@Stereotype\n"
+"public @interface Action {}]]>"
#. Tag: para
#: stereotypes.xml:103
#, no-c-format
-msgid ""
-"This helps us get technical concerns even further away from the business "
-"code!"
-msgstr ""
+msgid "This helps us get technical concerns even further away from the business code!"
+msgstr "这将能够帮助我们从业务代码中剥离技术关注点!"
#. Tag: title
#: stereotypes.xml:109
#, no-c-format
msgid "Name defaulting with stereotypes"
-msgstr ""
+msgstr "模板的默认命名"
#. Tag: para
#: stereotypes.xml:111
#, no-c-format
-msgid ""
-"Finally, we can specify that all Web Beans with a certain stereotype have a "
-"Web Bean name, defaulted by the Web Bean manager. Actions are often "
-"referenced in JSP pages, so they're a perfect use case for this feature. All "
-"we need to do is add an empty <literal>@Named</literal> annotation:"
-msgstr ""
+msgid "Finally, we can specify that all Web Beans with a certain stereotype have a Web Bean name, defaulted by the Web Bean manager. Actions are often referenced in JSP pages, so they're a perfect use case for this feature. All we need to do is add an empty <literal>@Named</literal> annotation:"
+msgstr "最后,我们可以为所有使用模板的Web Bean指定一个Web Bean名称,Web Bean管理器将其设为默认名称。JSP页面中常常引用动作类,所以它们是这个特性的最好的例子。我们所需做的就是添加一个空的 <literal>@Named</literal> 注释:"
#. Tag: programlisting
#: stereotypes.xml:116
@@ -300,35 +299,39 @@
"@Stereotype\n"
"public @interface Action {}]]>"
msgstr ""
+"<![CDATA[@Retention(RUNTIME)\n"
+"@Target(TYPE)\n"
+"@RequestScoped\n"
+"@Transactional(requiresNew=true)\n"
+"@Secure\n"
+"@Named\n"
+"@WebTier\n"
+"@Stereotype\n"
+"public @interface Action {}]]>"
#. Tag: para
#: stereotypes.xml:118
#, no-c-format
-msgid ""
-"Now, <literal>LoginAction</literal> will have the name <literal>loginAction</"
-"literal>."
-msgstr ""
+msgid "Now, <literal>LoginAction</literal> will have the name <literal>loginAction</literal>."
+msgstr "现在, <literal>LoginAction</literal> 将拥有一个名为 <literal>loginAction</literal> Web Bean名称."
#. Tag: title
#: stereotypes.xml:124
#, no-c-format
msgid "Standard stereotypes"
-msgstr ""
+msgstr "标准的模板"
#. Tag: para
#: stereotypes.xml:126
#, no-c-format
-msgid ""
-"We've already met two standard stereotypes defined by the Web Beans "
-"specification: <literal>@Interceptor</literal> and <literal>@Decorator</"
-"literal>."
-msgstr ""
+msgid "We've already met two standard stereotypes defined by the Web Beans specification: <literal>@Interceptor</literal> and <literal>@Decorator</literal>."
+msgstr "我们已经见到了Web Bean规范定义的两个标准的模板:<literal>@Interceptor</literal> 和 <literal>@Decorator</literal>。"
#. Tag: para
#: stereotypes.xml:129
#, no-c-format
msgid "Web Beans defines one further standard stereotype:"
-msgstr ""
+msgstr "Web Bean还定义了另一个标准模板:"
#. Tag: programlisting
#: stereotypes.xml:131
@@ -341,12 +344,16 @@
"@Retention(RUNTIME) \n"
"public @interface Model {} ]]>"
msgstr ""
+"<![CDATA[@Named \n"
+"@RequestScoped \n"
+"@Stereotype \n"
+"@Target({TYPE, METHOD}) \n"
+"@Retention(RUNTIME) \n"
+"public @interface Model {} ]]>"
#. Tag: para
#: stereotypes.xml:133
#, no-c-format
-msgid ""
-"This stereotype is intended for use with JSF. Instead of using JSF managed "
-"beans, just annotate a Web Bean <literal>@Model</literal>, and use it "
-"directly in your JSF page."
-msgstr ""
+msgid "This stereotype is intended for use with JSF. Instead of using JSF managed beans, just annotate a Web Bean <literal>@Model</literal>, and use it directly in your JSF page."
+msgstr "这个模板是为了JSF使用的。我们可以直接在一个Web Bean上使用 <literal>@Model</literal> 注释就可以让这个Web Bean替代JSF的管理Bean。你可以直接在JSF页面中使用这个Web Bean。"
+
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1959 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-03-13 03:36:41 -0400 (Fri, 13 Mar 2009)
New Revision: 1959
Modified:
doc/trunk/reference/zh-CN/ri-spi.po
Log:
simplified chinese of ri-spi section is finished
Modified: doc/trunk/reference/zh-CN/ri-spi.po
===================================================================
--- doc/trunk/reference/zh-CN/ri-spi.po 2009-03-13 07:08:44 UTC (rev 1958)
+++ doc/trunk/reference/zh-CN/ri-spi.po 2009-03-13 07:36:41 UTC (rev 1959)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-08 15:53+0000\n"
-"PO-Revision-Date: 2008-12-23 18:18+0800\n"
+"PO-Revision-Date: 2009-03-13 15:35+0800\n"
"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -22,29 +22,14 @@
#. Tag: para
#: ri-spi.xml:6
#, no-c-format
-msgid ""
-"Currently the Web Beans RI only runs in JBoss AS 5; integrating the RI into "
-"other EE environments (for example another application server like "
-"Glassfish), into a servlet container (like Tomcat), or with an Embedded "
-"EJB3.1 implementation is fairly easy. In this Appendix we will briefly "
-"discuss the steps needed."
-msgstr ""
-"目前,Web Bean的参考实现只能运行在JBoss AS5中;将参考实现整合到其他EE环境中"
-"(例如像Glassfish的其他的应用服务器)以及一个Servlet容器(像Tomcat)中或者一"
-"个内嵌的EJB3.1实现中相当容易。在附录中我们将简要的讨论所需的步骤。"
+msgid "Currently the Web Beans RI only runs in JBoss AS 5; integrating the RI into other EE environments (for example another application server like Glassfish), into a servlet container (like Tomcat), or with an Embedded EJB3.1 implementation is fairly easy. In this Appendix we will briefly discuss the steps needed."
+msgstr "目前,Web Bean的参考实现只能运行在JBoss AS5中;将参考实现整合到其他EE环境中(例如像Glassfish的其他的应用服务器)以及一个Servlet容器(像Tomcat)中或者一个内嵌的EJB3.1实现中相当容易。在附录中我们将简要的讨论所需的步骤。"
#. Tag: para
#: ri-spi.xml:15
#, no-c-format
-msgid ""
-"It should be possible to run Web Beans in an SE environment, but you'll to "
-"do more work, adding your own contexts and lifecycle. The Web Beans RI "
-"currently doesn't expose lifecycle extension points, so you would have to "
-"code directly against Web Beans RI classes."
-msgstr ""
-"Web Bean可以在SE环境中运行,但是你需要做更多的工作,添加你自己的上下文和生命"
-"周期。Web Bean参考实现目前没有暴露生命周期扩展点,所以你不得不直接编写Web "
-"Bean参考实现的类。"
+msgid "It should be possible to run Web Beans in an SE environment, but you'll to do more work, adding your own contexts and lifecycle. The Web Beans RI currently doesn't expose lifecycle extension points, so you would have to code directly against Web Beans RI classes."
+msgstr "Web Bean可以在SE环境中运行,但是你需要做更多的工作,添加你自己的上下文和生命周期。Web Bean参考实现目前没有暴露生命周期扩展点,所以你不得不直接编写Web Bean参考实现的类。"
#. Tag: title
#: ri-spi.xml:24
@@ -55,27 +40,20 @@
#. Tag: para
#: ri-spi.xml:26
#, fuzzy, no-c-format
-msgid ""
-"The Web Beans SPI is located in <literal>webbeans-ri-spi</literal> module, "
-"and packaged as <literal>webbeans-ri-spi.jar</literal>. Some SPIs are "
-"optional, if you need to override the default behavior, others are required."
-msgstr ""
-"Web Bean的SPI位于<literal>webbeans-ri-spi</literal>模块中,打包为"
-"<literal>webbeans-ri-spi.jar</literal>。"
+msgid "The Web Beans SPI is located in <literal>webbeans-ri-spi</literal> module, and packaged as <literal>webbeans-ri-spi.jar</literal>. Some SPIs are optional, if you need to override the default behavior, others are required."
+msgstr "Web Bean的SPI位于<literal>webbeans-ri-spi</literal>模块中,打包为<literal>webbeans-ri-spi.jar</literal>。"
#. Tag: para
#: ri-spi.xml:33
#, no-c-format
-msgid ""
-"All interfaces in the SPI support the decorator pattern and provide a "
-"<literal>Forwarding</literal> class."
-msgstr ""
+msgid "All interfaces in the SPI support the decorator pattern and provide a <literal>Forwarding</literal> class."
+msgstr "所有的SPI接口都支持装饰器模式,并且提供一个 <literal>Forwarding</literal> 类。"
#. Tag: title
#: ri-spi.xml:39
#, no-c-format
msgid "Web Bean Discovery"
-msgstr ""
+msgstr "Web Bean的发现"
#. Tag: programlisting
#: ri-spi.xml:41
@@ -83,8 +61,7 @@
msgid ""
"<![CDATA[public interface WebBeanDiscovery {\n"
" /**\n"
-" * Gets list of all classes in classpath archives with web-beans.xml "
-"files\n"
+" * Gets list of all classes in classpath archives with web-beans.xml files\n"
" * \n"
" * @return An iterable over the classes \n"
" */\n"
@@ -101,8 +78,7 @@
msgstr ""
"<![CDATA[public interface WebBeanDiscovery {\n"
" /**\n"
-" * Gets list of all classes in classpath archives with web-beans.xml "
-"files\n"
+" * Gets list of all classes in classpath archives with web-beans.xml files\n"
" * \n"
" * @return An iterable over the classes \n"
" */\n"
@@ -127,27 +103,20 @@
#. Tag: para
#: ri-spi.xml:43
#, no-c-format
-msgid ""
-"The discovery of Web Bean classes and <literal>web-bean.xml</literal> files "
-"is self-explanatory (the algorithm is described in Section 11.1 of the JSR-"
-"299 specification, and isn't repeated here)."
-msgstr ""
+msgid "The discovery of Web Bean classes and <literal>web-bean.xml</literal> files is self-explanatory (the algorithm is described in Section 11.1 of the JSR-299 specification, and isn't repeated here)."
+msgstr "Web Bean类的发现和 <literal>web-bean.xml</literal> 配置文件的都是自解释性的(算法在JSR-299规范中已经描述了,这里就不再重复)"
#. Tag: title
#: ri-spi.xml:52
#, no-c-format
msgid "EJB Discovery"
-msgstr ""
+msgstr "EJB发现"
#. Tag: para
#: ri-spi.xml:54
#, no-c-format
-msgid ""
-"The Web Beans RI also delegates EJB3 bean discovery to the container so that "
-"it doesn't have to scan for EJB3 annotations or parse <literal>ejb-jar.xml</"
-"literal>. For each EJB in the application an EJBDescriptor should be "
-"discovered:"
-msgstr ""
+msgid "The Web Beans RI also delegates EJB3 bean discovery to the container so that it doesn't have to scan for EJB3 annotations or parse <literal>ejb-jar.xml</literal>. For each EJB in the application an EJBDescriptor should be discovered:"
+msgstr "Web Bean参考实现也将EJB3 Bean的发现委托给容器,以便它不用再扫描EJB3注释和解析 <literal>ejb-jar.xml</literal> 文件。对于应用中的每个EJB都应发现一个EJBDescriptor:"
#. Tag: programlisting
#: ri-spi.xml:61
@@ -166,6 +135,18 @@
" \n"
"}]]>"
msgstr ""
+"<![CDATA[public interface EjbDiscovery\n"
+"{\n"
+" public static final String PROPERTY_NAME = EjbDiscovery.class.getName();\n"
+" \n"
+" /**\n"
+" * Gets a descriptor for each EJB in the application\n"
+" * \n"
+" * @return The bean class to descriptor map \n"
+" */\n"
+" public Iterable<EjbDescriptor<?>> discoverEjbs();\n"
+" \n"
+"}]]>"
#. Tag: programlisting
#: ri-spi.xml:63
@@ -185,16 +166,14 @@
" * \n"
" * @return An iterator over the local business interfaces\n"
" */\n"
-" public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces"
-"();\n"
+" public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces();\n"
" \n"
" /**\n"
" * Gets the remote business interfaces of the EJB\n"
" * \n"
" * @return An iterator over the remote business interfaces\n"
" */\n"
-" public Iterable<BusinessInterfaceDescriptor<?>> "
-"getRemoteBusinessInterfaces();\n"
+" public Iterable<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces();\n"
" \n"
" /**\n"
" * Get the remove methods of the EJB\n"
@@ -241,139 +220,157 @@
" \n"
"}]]>"
msgstr ""
+"<![CDATA[public interface EjbDescriptor<T> {\n"
+" \n"
+" /**\n"
+" * Gets the EJB type\n"
+" * \n"
+" * @return The EJB Bean class\n"
+" */\n"
+" public Class<T> getType();\n"
+"\n"
+" /**\n"
+" * Gets the local business interfaces of the EJB\n"
+" * \n"
+" * @return An iterator over the local business interfaces\n"
+" */\n"
+" public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces();\n"
+" \n"
+" /**\n"
+" * Gets the remote business interfaces of the EJB\n"
+" * \n"
+" * @return An iterator over the remote business interfaces\n"
+" */\n"
+" public Iterable<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces();\n"
+" \n"
+" /**\n"
+" * Get the remove methods of the EJB\n"
+" * \n"
+" * @return An iterator over the remove methods\n"
+" */\n"
+" public Iterable<Method> getRemoveMethods();\n"
+"\n"
+" /**\n"
+" * Indicates if the bean is stateless\n"
+" * \n"
+" * @return True if stateless, false otherwise\n"
+" */\n"
+" public boolean isStateless();\n"
+"\n"
+" /**\n"
+" * Indicates if the bean is a EJB 3.1 Singleton\n"
+" * \n"
+" * @return True if the bean is a singleton, false otherwise\n"
+" */\n"
+" public boolean isSingleton();\n"
+"\n"
+" /**\n"
+" * Indicates if the EJB is stateful\n"
+" * \n"
+" * @return True if the bean is stateful, false otherwise\n"
+" */\n"
+" public boolean isStateful();\n"
+"\n"
+" /**\n"
+" * Indicates if the EJB is and MDB\n"
+" * \n"
+" * @return True if the bean is an MDB, false otherwise\n"
+" */\n"
+" public boolean isMessageDriven();\n"
+"\n"
+" /**\n"
+" * Gets the EJB name\n"
+" * \n"
+" * @return The name\n"
+" */\n"
+" public String getEjbName();\n"
+" \n"
+" \n"
+"}]]>"
#. Tag: para
#: ri-spi.xml:65
#, no-c-format
-msgid ""
-"The <literal>EjbDescriptor</literal> is fairly self-explanatory, and should "
-"return the relevant metadata as defined in the EJB specification. In "
-"addition to these two interfaces, there is "
-"<literal>BusinessInterfaceDescriptor</literal> which represents a local "
-"business interface (encapsulating the interface class and jndi name used to "
-"look up an instance of the EJB)."
-msgstr ""
+msgid "The <literal>EjbDescriptor</literal> is fairly self-explanatory, and should return the relevant metadata as defined in the EJB specification. In addition to these two interfaces, there is <literal>BusinessInterfaceDescriptor</literal> which represents a local business interface (encapsulating the interface class and jndi name used to look up an instance of the EJB)."
+msgstr " <literal>EjbDescriptor</literal> 具有相当的自解释性,应该返回EJB规范中定义的相关元数据。除了这两个接口,还有一个表示本地业务接口的 <literal>BusinessInterfaceDescriptor</literal> (封装了接口类和用于查询EJB实例的jndi名字)"
#. Tag: title
#: ri-spi.xml:77
#, no-c-format
-msgid ""
-"<literal>@EJB</literal>, <literal>@PersistenceContext</literal> and "
-"<literal>@Resource</literal> resolution"
-msgstr ""
+msgid "<literal>@EJB</literal>, <literal>@PersistenceContext</literal> and <literal>@Resource</literal> resolution"
+msgstr "<literal>@EJB</literal>, <literal>@PersistenceContext</literal> 和 <literal>@Resource</literal> 的解析"
#. Tag: para
#: ri-spi.xml:79
#, no-c-format
-msgid ""
-"The resolution of <literal>@EJB</literal>, <literal>@PersistenceContext</"
-"literal> and <literal>@Resource</literal> is delegated to the container. You "
-"must provide an implementation of <literal>org.jboss.webbeans.ejb.spi."
-"EjbResolver</literal> which provides these operations. Web Beans passes in "
-"the <literal>javax.inject.manager.InjectionPoint</literal> the resolution is "
-"for, as well as the <literal>NamingContext</literal> in use for each "
-"resolution request."
-msgstr ""
+msgid "The resolution of <literal>@EJB</literal>, <literal>@PersistenceContext</literal> and <literal>@Resource</literal> is delegated to the container. You must provide an implementation of <literal>org.jboss.webbeans.ejb.spi.EjbResolver</literal> which provides these operations. Web Beans passes in the <literal>javax.inject.manager.InjectionPoint</literal> the resolution is for, as well as the <literal>NamingContext</literal> in use for each resolution request."
+msgstr "<literal>@EJB</literal>, <literal>@PersistenceContext</literal> 和 <literal>@Resource</literal> 的解析被委托给容器。你必须提供一个 <literal>org.jboss.webbeans.ejb.spi.EjbResolver</literal> 实现来完成这些工作。每次解析请求到来时,Web Beans都将 <literal>javax.inject.manager.InjectionPoint</literal> 以及 <literal>NamingContext</literal> 传递进来以便解析。"
#. Tag: title
#: ri-spi.xml:104
#, no-c-format
msgid "The application context"
-msgstr ""
+msgstr "应用上下文"
#. Tag: para
#: ri-spi.xml:106
#, no-c-format
-msgid ""
-"Web Beans expects the Application Server or other container to provide the "
-"storage for each application's context. The <literal>org.jboss.webbeans."
-"context.api.BeanStore</literal> should be implemented to provide an "
-"application scoped storage. You may find <literal>org.jboss.webbeans.context."
-"api.helpers.ConcurrentHashMapBeanStore</literal> useful."
-msgstr ""
+msgid "Web Beans expects the Application Server or other container to provide the storage for each application's context. The <literal>org.jboss.webbeans.context.api.BeanStore</literal> should be implemented to provide an application scoped storage. You may find <literal>org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore</literal> useful."
+msgstr "Web Bean期望应用服务器或者其他容器能够提供每个应用上下文的存储。<literal>org.jboss.webbeans.context.api.BeanStore</literal> 应该被实现以便提供一个应用范围的存储。你也许会发现 <literal>org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore</literal> 非常有用。"
#. Tag: title
#: ri-spi.xml:119
#, no-c-format
msgid "Bootstrap and shutdown"
-msgstr ""
+msgstr "自举和停止"
#. Tag: para
#: ri-spi.xml:120
#, no-c-format
-msgid ""
-"The <literal>org.jboss.webbeans.bootstrap.api.Bootstrap</literal> interface "
-"defines the bootstrap for Web Beans. To boot Web Beans, you must obtain an "
-"instance of <literal>org.jboss.webbeans.bootstrap.WebBeansBootstrap</"
-"literal> (which implements <literal>Boostrap</literal>), tell it about the "
-"SPIs in use, and then request the container start."
-msgstr ""
+msgid "The <literal>org.jboss.webbeans.bootstrap.api.Bootstrap</literal> interface defines the bootstrap for Web Beans. To boot Web Beans, you must obtain an instance of <literal>org.jboss.webbeans.bootstrap.WebBeansBootstrap</literal> (which implements <literal>Boostrap</literal>), tell it about the SPIs in use, and then request the container start."
+msgstr " <literal>org.jboss.webbeans.bootstrap.api.Bootstrap</literal> 接口定义了Web Bean的自举机制。为了启动Web Beans,你必须获得一个<literal>org.jboss.webbeans.bootstrap.WebBeansBootstrap</literal> 实例(它实现了<literal>Boostrap</literal>) ,告诉它使用的SPI,然后请求容器启动。 "
#. Tag: para
#: ri-spi.xml:129
#, no-c-format
-msgid ""
-"The bootstrap is split into phases, bootstrap initialization and bootstrap. "
-"Initialization will create a manager, and add the standard (specification "
-"defined) contexts. Bootstrap will discover EJBs, classes and XML; add beans "
-"defined using annotations; add beans defined using XML; and validate all "
-"beans."
-msgstr ""
+msgid "The bootstrap is split into phases, bootstrap initialization and bootstrap. Initialization will create a manager, and add the standard (specification defined) contexts. Bootstrap will discover EJBs, classes and XML; add beans defined using annotations; add beans defined using XML; and validate all beans."
+msgstr "自举可以划分为阶段,自举初始化和自举。初始化将创建一个管理器,添加标准(规范定义的)的上下文。自举将发现EJB,类和XML;添加注释定义的Bean;添加XML定义的Bean;和验证所有的Bean。"
#. Tag: para
#: ri-spi.xml:137
#, no-c-format
-msgid ""
-"To initialize the bootstrap you call <literal>Bootstrap.initialize()</"
-"literal>. Before calling <literal>initialize()</literal> you must have "
-"called <literal>Bootstrap.setEjbResolver()</literal>. If you are not using "
-"the built in <literal>DefaultNamingContext</literal> or the built in "
-"<literal>DefaultResourceLoader</literal> you must set these before calling "
-"<literal>initialize()</literal>."
-msgstr ""
+msgid "To initialize the bootstrap you call <literal>Bootstrap.initialize()</literal>. Before calling <literal>initialize()</literal> you must have called <literal>Bootstrap.setEjbResolver()</literal>. If you are not using the built in <literal>DefaultNamingContext</literal> or the built in <literal>DefaultResourceLoader</literal> you must set these before calling <literal>initialize()</literal>."
+msgstr "为了初始化自举,你需要调用 <literal>Bootstrap.initialize()</literal> 。在调用 <literal>initialize()</literal> 之前你必须调用 <literal>Bootstrap.setEjbResolver()</literal> 。如果你没有使用内置的<literal>DefaultNamingContext</literal>或者<literal>DefaultResourceLoader</literal>,你必须在调用<literal>initialize()</literal>之前设置它们。"
#. Tag: para
#: ri-spi.xml:147
#, no-c-format
-msgid ""
-"Having called <literal>initialize()</literal>, the <literal>Manager</"
-"literal> can be obtained by calling <literal>Bootstrap.getManager()</"
-"literal>."
-msgstr ""
+msgid "Having called <literal>initialize()</literal>, the <literal>Manager</literal> can be obtained by calling <literal>Bootstrap.getManager()</literal>."
+msgstr "调用<literal>initialize()</literal>后,我们能够通过<literal>Bootstrap.getManager()</literal>来获得<literal>管理器</literal>。"
#. Tag: para
#: ri-spi.xml:153
#, no-c-format
-msgid ""
-"To boot the container you call <literal>Bootstrap.boot()</literal>. Before "
-"calling <literal>boot()</literal> you must have called <literal>Bootstrap."
-"setWebBeanDiscovery()</literal>, <literal>Bootstrap.setEjbDiscovery()</"
-"literal> and <literal>Bootstrap.setApplicationContext()</literal>."
-msgstr ""
+msgid "To boot the container you call <literal>Bootstrap.boot()</literal>. Before calling <literal>boot()</literal> you must have called <literal>Bootstrap.setWebBeanDiscovery()</literal>, <literal>Bootstrap.setEjbDiscovery()</literal> and <literal>Bootstrap.setApplicationContext()</literal>."
+msgstr "启动容器你需要调用 <literal>Bootstrap.boot()</literal> 。在调用<literal>boot()</literal>之前,你必须调用<literal>Bootstrap.setWebBeanDiscovery()</literal>, <literal>Bootstrap.setEjbDiscovery()</literal> 和 <literal>Bootstrap.setApplicationContext()</literal>。"
#. Tag: para
#: ri-spi.xml:161
#, no-c-format
-msgid ""
-"To shutdown the container you call <literal>Bootstrap.shutdown()</literal>. "
-"This allows the container to perform any cleanup operations needed."
-msgstr ""
+msgid "To shutdown the container you call <literal>Bootstrap.shutdown()</literal>. This allows the container to perform any cleanup operations needed."
+msgstr "要关闭容器,你需要调用 <literal>Bootstrap.shutdown()</literal>。这将让容器执行一些必要的清洁工作。"
#. Tag: title
#: ri-spi.xml:170
#, no-c-format
msgid "JNDI"
-msgstr ""
+msgstr "JNDI"
#. Tag: para
#: ri-spi.xml:172
#, no-c-format
-msgid ""
-"The Web Beans RI implements JNDI binding and lookup according to standards, "
-"however you may want to alter the binding and lookup (for example in an "
-"environment where JNDI isn't available). To do this, implement <literal>org."
-"jboss.webbeans.resources.spi.NamingContext</literal>:"
-msgstr ""
+msgid "The Web Beans RI implements JNDI binding and lookup according to standards, however you may want to alter the binding and lookup (for example in an environment where JNDI isn't available). To do this, implement <literal>org.jboss.webbeans.resources.spi.NamingContext</literal>:"
+msgstr " Web Beans 参考实现实现了JNDI 的绑定和根据标准来查询,然而你可能想要改变这些绑定和查询(例如在一个没有JNDI的环境中)。你可以通过实现 <literal>org.jboss.webbeans.resources.spi.NamingContext</literal>来完成这个工作:"
#. Tag: programlisting
#: ri-spi.xml:180
@@ -401,23 +398,39 @@
" \n"
"}]]>"
msgstr ""
+"<![CDATA[public interface NamingContext extends Serializable {\n"
+" \n"
+" /**\n"
+" * Typed JNDI lookup\n"
+" * \n"
+" * @param <T> The type\n"
+" * @param name The JNDI name\n"
+" * @param expectedType The expected type\n"
+" * @return The object\n"
+" */\n"
+" public <T> T lookup(String name, Class<? extends T> expectedType);\n"
+"\n"
+" /**\n"
+" * Binds an item to JNDI\n"
+" * \n"
+" * @param name The key to bind under\n"
+" * @param value The item to bind\n"
+" */\n"
+" public void bind(String name, Object value);\n"
+" \n"
+"}]]>"
#. Tag: title
#: ri-spi.xml:185
#, no-c-format
msgid "Resource loading"
-msgstr ""
+msgstr "资源加载"
#. Tag: para
#: ri-spi.xml:187
#, no-c-format
-msgid ""
-"The Web Beans RI needs to load classes and resources from the classpath at "
-"various times. By default, they are loaded from the same classloader that "
-"was used to load the RI, however this may not be correct for some "
-"environments. If this is case, you can implement <literal>org.jboss.webbeans."
-"spi.ResourceLoader</literal>:"
-msgstr ""
+msgid "The Web Beans RI needs to load classes and resources from the classpath at various times. By default, they are loaded from the same classloader that was used to load the RI, however this may not be correct for some environments. If this is case, you can implement <literal>org.jboss.webbeans.spi.ResourceLoader</literal>:"
+msgstr "Web Beans参考实现需要在不同时间从类路径上加载类和资源。默认情况下,它们使用加载参考实现的类加载器加载,但是这在一些环境中可能是不适合的。如果出现这种情况的话,你可以实现<literal>org.jboss.webbeans.spi.ResourceLoader</literal> :"
#. Tag: programlisting
#: ri-spi.xml:195
@@ -453,137 +466,132 @@
"}\n"
" ]]>"
msgstr ""
+"<![CDATA[\n"
+" public interface ResourceLoader {\n"
+" \n"
+" /**\n"
+" * Creates a class from a given FQCN\n"
+" * \n"
+" * @param name The name of the clsas\n"
+" * @return The class\n"
+" */\n"
+" public Class<?> classForName(String name);\n"
+" \n"
+" /**\n"
+" * Gets a resource as a URL by name\n"
+" * \n"
+" * @param name The name of the resource\n"
+" * @return An URL to the resource\n"
+" */\n"
+" public URL getResource(String name);\n"
+" \n"
+" /**\n"
+" * Gets resources as URLs by name\n"
+" * \n"
+" * @param name The name of the resource\n"
+" * @return An iterable reference to the URLS\n"
+" */\n"
+" public Iterable<URL> getResources(String name);\n"
+" \n"
+"}\n"
+" ]]>"
#. Tag: title
#: ri-spi.xml:200
#, no-c-format
msgid "Servlet injection"
-msgstr ""
+msgstr "Servlet 注入"
#. Tag: para
#: ri-spi.xml:202
#, no-c-format
-msgid ""
-"Java EE / Servlet does not provide any hooks which can be used to provide "
-"injection into Servlets, so Web Beans provides an API to allow the container "
-"to request JSR-299 injection for a Servlet."
-msgstr ""
+msgid "Java EE / Servlet does not provide any hooks which can be used to provide injection into Servlets, so Web Beans provides an API to allow the container to request JSR-299 injection for a Servlet."
+msgstr "Java EE/Servlet并不没有提供任何钩子来支持向Servlet注入,所以Web Bean提供了一个接口来允许容器为一个Servlet请求JSR-299的注入。"
#. Tag: para
#: ri-spi.xml:208
#, no-c-format
-msgid ""
-"To be compliant with JSR-299, the container should request servlet injection "
-"for each newly instantiated servlet after the constructor returns and before "
-"the servlet is placed into service."
-msgstr ""
+msgid "To be compliant with JSR-299, the container should request servlet injection for each newly instantiated servlet after the constructor returns and before the servlet is placed into service."
+msgstr "为了和JSR-299兼容,容器应该在构造器返回之后,在Servlet被放到服务中之前,为每个新实例化的Servlet请求Servlet注入。"
#. Tag: para
#: ri-spi.xml:214
#, no-c-format
-msgid ""
-"To perform injection on a servlet call <literal>WebBeansManager.injectServlet"
-"()</literal>. The manager can be obtained from <literal>Bootstrap.getManager"
-"()</literal>."
-msgstr ""
+msgid "To perform injection on a servlet call <literal>WebBeansManager.injectServlet()</literal>. The manager can be obtained from <literal>Bootstrap.getManager()</literal>."
+msgstr "执行Servlet注入时需要调用 <literal>WebBeansManager.injectServlet()</literal>。你可以通过 <literal>Bootstrap.getManager()</literal>来获得管理器。"
#. Tag: title
#: ri-spi.xml:225
#, no-c-format
msgid "The contract with the container"
-msgstr ""
+msgstr "容器的合约"
#. Tag: para
#: ri-spi.xml:227
#, no-c-format
-msgid ""
-"There are a number of requirements that the Web Beans RI places on the "
-"container for correct functioning that fall outside implementation of APIs"
-msgstr ""
+msgid "There are a number of requirements that the Web Beans RI places on the container for correct functioning that fall outside implementation of APIs"
+msgstr "为了接口实现之外的正确的功能,Web Beans参考实现对容器有大量的要求。"
#. Tag: term
#: ri-spi.xml:235
#, no-c-format
msgid "Classloader isolation"
-msgstr ""
+msgstr "类加载器隔离"
#. Tag: para
#: ri-spi.xml:239
#, no-c-format
-msgid ""
-"If you are integrating the Web Beans RI into an environment that supports "
-"deployment of multiple applications, you must enable, automatically, or "
-"through user configuation, classloader isolation for each Web Beans "
-"application."
-msgstr ""
+msgid "If you are integrating the Web Beans RI into an environment that supports deployment of multiple applications, you must enable, automatically, or through user configuation, classloader isolation for each Web Beans application."
+msgstr "如果你将一个Web Bean参考实现整合到一个支持多应用部署的环境中,你需要以用户配置或者自动化方式为每个Web Bean应用激活类加载器隔离。"
#. Tag: term
#: ri-spi.xml:248
#, no-c-format
msgid "Servlet listener and filters"
-msgstr ""
+msgstr "Servlet监听器和过滤器"
#. Tag: para
#: ri-spi.xml:252
#, no-c-format
-msgid ""
-"If you are integrating the Web Beans into a Servlet environment you must "
-"register <literal>org.jboss.webbeans.servlet.WebBeansListener</literal> as a "
-"Servlet listener, either automatically, or through user configuration, for "
-"each Web Beans application which uses Servlet."
-msgstr ""
+msgid "If you are integrating the Web Beans into a Servlet environment you must register <literal>org.jboss.webbeans.servlet.WebBeansListener</literal> as a Servlet listener, either automatically, or through user configuration, for each Web Beans application which uses Servlet."
+msgstr "如果你将Web Bean整合到一个Servlet环境中,对每个使用Servlet的 Web Bean应用,你需要以用户配置或者自动化形式将 <literal>org.jboss.webbeans.servlet.WebBeansListener</literal> 注册为一个Servlet监听器。"
#. Tag: para
#: ri-spi.xml:261
#, no-c-format
-msgid ""
-"If you are integrating the Web Beans into a JSF environment you must "
-"register <literal>org.jboss.webbeans.servlet.ConversationPropagationFilter</"
-"literal> as a Servlet listener, either automatically, or through user "
-"configuration, for each Web Beans application which uses JSF. This filter "
-"can be registered for all Servlet deployment safely."
-msgstr ""
+msgid "If you are integrating the Web Beans into a JSF environment you must register <literal>org.jboss.webbeans.servlet.ConversationPropagationFilter</literal> as a Servlet listener, either automatically, or through user configuration, for each Web Beans application which uses JSF. This filter can be registered for all Servlet deployment safely."
+msgstr "如果你将Web Bean整合到一个JSF环境中,对每个使用JSF的 Web Bean应用,你需要以用户配置或者自动化形式将 <literal>org.jboss.webbeans.servlet.ConversationPropagationFilter</literal> 注册为一个Servlet监听器。这个过滤器可以安全地向所有Servlet部署注册。"
#. Tag: term
#: ri-spi.xml:273
#, no-c-format
msgid "Session Bean Interceptor"
-msgstr ""
+msgstr "会话Bean拦截器"
#. Tag: para
#: ri-spi.xml:277
#, no-c-format
-msgid ""
-"If you are integrating the Web Beans into an EJB environment you must "
-"register <literal>org.jboss.webbeans.ejb.SessionBeanInterceptor</literal> as "
-"a EJB interceptor for all EJBs in the application, either automatically, or "
-"through user configuration, for each Web Beans application which uses "
-"enterprise beans."
-msgstr ""
+msgid "If you are integrating the Web Beans into an EJB environment you must register <literal>org.jboss.webbeans.ejb.SessionBeanInterceptor</literal> as a EJB interceptor for all EJBs in the application, either automatically, or through user configuration, for each Web Beans application which uses enterprise beans."
+msgstr "如果你将Web Beans整合到EJB环境中,对每个使用企业级Bean的Web Bean应用,你需要以用户配置或者自动化形式将 <literal>org.jboss.webbeans.ejb.SessionBeanInterceptor</literal> 注册为应用中所有EJB的EJB拦截器。"
#. Tag: para
#: ri-spi.xml:287
#, no-c-format
-msgid ""
-"You must register the <literal>SessionBeanInterceptor</literal> as the inner "
-"most interceptor in the stack for all EJBs."
-msgstr ""
+msgid "You must register the <literal>SessionBeanInterceptor</literal> as the inner most interceptor in the stack for all EJBs."
+msgstr "你必须为所有的EJB在栈中将<literal>SessionBeanInterceptor</literal> 注册为一个最内部的拦截器。"
#. Tag: term
#: ri-spi.xml:295
#, no-c-format
msgid "The <literal>webbeans-ri.jar</literal>"
-msgstr ""
+msgstr "<literal>webbeans-ri.jar</literal>"
#. Tag: para
#: ri-spi.xml:299
#, no-c-format
-msgid ""
-"If you are integrating the Web Beans into an environment that supports "
-"deployment of applications, you must insert the <literal>webbeans-ri.jar</"
-"literal> into the applications isolated classloader. It cannot be loaded "
-"from a shared classloader."
-msgstr ""
+msgid "If you are integrating the Web Beans into an environment that supports deployment of applications, you must insert the <literal>webbeans-ri.jar</literal> into the applications isolated classloader. It cannot be loaded from a shared classloader."
+msgstr "如果你将Web Bean整合到一个支持应用部署的环境中,你必须将<literal>webbeans-ri.jar</literal> 插入到应用隔离的类加载器中。它不能被一个共享的类加载器加载。"
#~ msgid "Currently, the only SPI to implement is the bootstrap spi:"
#~ msgstr "目前,只有bootstrap SPI可以实现:"
+
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1958 - tck/trunk.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-13 03:08:44 -0400 (Fri, 13 Mar 2009)
New Revision: 1958
Modified:
tck/trunk/pom.xml
Log:
switch to tck-utils snapshot for updated report
Modified: tck/trunk/pom.xml
===================================================================
--- tck/trunk/pom.xml 2009-03-13 07:02:11 UTC (rev 1957)
+++ tck/trunk/pom.xml 2009-03-13 07:08:44 UTC (rev 1958)
@@ -109,12 +109,12 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>tck-utils-api</artifactId>
- <version>0.9</version>
+ <version>0.9.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>tck-utils-impl</artifactId>
- <version>0.9</version>
+ <version>0.9.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jboss.ejb3</groupId>
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1957 - doc/trunk/reference/zh-CN.
by webbeans-commits@lists.jboss.org
Author: alartin
Date: 2009-03-13 03:02:11 -0400 (Fri, 13 Mar 2009)
New Revision: 1957
Modified:
doc/trunk/reference/zh-CN/xml.po
Log:
simplified Chinese translation of xml section is finished
Modified: doc/trunk/reference/zh-CN/xml.po
===================================================================
--- doc/trunk/reference/zh-CN/xml.po 2009-03-13 06:39:07 UTC (rev 1956)
+++ doc/trunk/reference/zh-CN/xml.po 2009-03-13 07:02:11 UTC (rev 1957)
@@ -3,11 +3,11 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: master.xml \n"
+"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2008-12-19 20:26+0000\n"
-"PO-Revision-Date: 2008-12-19 20:26+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2009-03-13 15:01+0800\n"
+"Last-Translator: Sean Wu <alartin(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,105 +17,79 @@
#: xml.xml:4
#, no-c-format
msgid "Defining Web Beans using XML"
-msgstr ""
+msgstr "使用XML定义Web Bean"
#. Tag: para
#: xml.xml:6
#, no-c-format
-msgid ""
-"So far, we've seen plenty of examples of Web Beans declared using "
-"annotations. However, there are a couple of occasions when we can't use "
-"annotations to define the Web Bean:"
-msgstr ""
+msgid "So far, we've seen plenty of examples of Web Beans declared using annotations. However, there are a couple of occasions when we can't use annotations to define the Web Bean:"
+msgstr "目前为止,我们看了大量使用注释来声明Web Bean的例子。然而,我们有时候并不使用注释来定义Web Bean,如下列情况:"
#. Tag: para
#: xml.xml:12
#, no-c-format
msgid "when the implementation class comes from some preexisting library, or"
-msgstr ""
+msgstr "当实现类是从先前已经存在的类库中产生的时候,或者"
#. Tag: para
#: xml.xml:15
#, no-c-format
-msgid ""
-"when there should be multiple Web Beans with the same implementation class."
-msgstr ""
+msgid "when there should be multiple Web Beans with the same implementation class."
+msgstr "多个Web Bean对应同一个实现类的时候。"
#. Tag: para
#: xml.xml:20
#, no-c-format
msgid "In either of these cases, Web Beans gives us two options:"
-msgstr ""
+msgstr "在上述任何一种情况下,Web Bean给我们两种选择:"
#. Tag: para
#: xml.xml:23
#, no-c-format
msgid "write a producer method, or"
-msgstr ""
+msgstr "写一个生产者方法,或者"
#. Tag: para
#: xml.xml:24
#, no-c-format
msgid "declare the Web Bean using XML."
-msgstr ""
+msgstr "使用XML来声明Web Bean。"
#. Tag: para
#: xml.xml:27
#, no-c-format
-msgid ""
-"Many frameworks use XML to provide metadata relating to Java classes. "
-"However, Web Beans uses a very different approach to specifying the names of "
-"Java classes, fields or methods to most other frameworks. Instead of writing "
-"class and member names as the string values of XML elements and attributes, "
-"Web Beans lets you use the class or member name as the name of the XML "
-"element."
-msgstr ""
+msgid "Many frameworks use XML to provide metadata relating to Java classes. However, Web Beans uses a very different approach to specifying the names of Java classes, fields or methods to most other frameworks. Instead of writing class and member names as the string values of XML elements and attributes, Web Beans lets you use the class or member name as the name of the XML element."
+msgstr "很多框架使用XML来提供Java类相关的元数据。然而,Web Bean使用了和大多其他框架不同的方法来指定Java类的名字,域或者方法。Web Bean让你使用类或者成员名作为XML元素名,而不是将类和成员名作为XML元素的字符串值来声明Web Bean。"
#. Tag: para
#: xml.xml:33
#, no-c-format
-msgid ""
-"The advantage of this approach is that you can write an XML schema that "
-"prevents spelling errors in your XML document. It's even possible for a tool "
-"to generate the XML schema automatically from the compiled Java code. Or, an "
-"integrated development environment could perform the same validation without "
-"the need for the explicit intermediate generation step."
-msgstr ""
+msgid "The advantage of this approach is that you can write an XML schema that prevents spelling errors in your XML document. It's even possible for a tool to generate the XML schema automatically from the compiled Java code. Or, an integrated development environment could perform the same validation without the need for the explicit intermediate generation step."
+msgstr "这种方法的好处是你可以使用XML模式来验证XML, 阻止XML文档中的拼写错误。它甚至可以让一个工具从编译好的Java代码中自动生成XML模式。或者一个整合开发环境(IDE)可以直接进行验证,无需使用显式的中间生成步骤。"
#. Tag: title
#: xml.xml:40
#, no-c-format
msgid "Declaring Web Bean classes"
-msgstr ""
+msgstr "声明Web Bean类"
#. Tag: para
#: xml.xml:42
#, no-c-format
-msgid ""
-"For each Java package, Web Beans defines a corresponding XML namespace. The "
-"namespace is formed by prepending <literal>urn:java:</literal> to the Java "
-"package name. For the package <literal>com.mydomain.myapp</literal>, the XML "
-"namespace is <literal>urn:java:com.mydomain.myapp</literal>."
-msgstr ""
+msgid "For each Java package, Web Beans defines a corresponding XML namespace. The namespace is formed by prepending <literal>urn:java:</literal> to the Java package name. For the package <literal>com.mydomain.myapp</literal>, the XML namespace is <literal>urn:java:com.mydomain.myapp</literal>."
+msgstr "对于每个Java包,Web Bean定义了一个对应的XML名域空间。这个名域由 <literal>urn:java:</literal>前缀加上Java包名组成。对于 <literal>com.mydomain.myapp</literal> 包来说,对应的XML名域是 <literal>urn:java:com.mydomain.myapp</literal>。"
#. Tag: para
#: xml.xml:47
#, no-c-format
-msgid ""
-"Java types belonging to a package are referred to using an XML element in "
-"the namespace corresponding to the package. The name of the element is the "
-"name of the Java type. Fields and methods of the type are specified by child "
-"elements in the same namespace. If the type is an annotation, members are "
-"specified by attributes of the element."
-msgstr ""
+msgid "Java types belonging to a package are referred to using an XML element in the namespace corresponding to the package. The name of the element is the name of the Java type. Fields and methods of the type are specified by child elements in the same namespace. If the type is an annotation, members are specified by attributes of the element."
+msgstr "属于一个包的Java类型指的是在对应这个包的名域中使用一个XML元素。元素的名字就是Java类型的名字。类型的域和方法通过相同的名域下的子元素定义。如果类型是一个注释的话,其成员通过这个元素的属性指定。"
#. Tag: para
#: xml.xml:53
#, no-c-format
-msgid ""
-"For example, the element <literal><util:Date/></literal> in the "
-"following XML fragment refers to the class <literal>java.util.Date</literal>:"
-msgstr ""
+msgid "For example, the element <literal><util:Date/></literal> in the following XML fragment refers to the class <literal>java.util.Date</literal>:"
+msgstr "例如, 在下面的XML片段中的元素<literal><util:Date/></literal>指的是 <literal>java.util.Date</literal> 类:"
#. Tag: programlisting
#: xml.xml:56
@@ -128,35 +102,36 @@
"\n"
"</WebBeans>]]>"
msgstr ""
+"<![CDATA[<WebBeans xmlns=\"urn:java:javax.webbeans\"\n"
+" xmlns:util=\"urn:java:java.util\">\n"
+"\n"
+" <util:Date/>\n"
+"\n"
+"</WebBeans>]]>"
#. Tag: para
#: xml.xml:58
#, no-c-format
-msgid ""
-"And this is all the code we need to declare that <literal>Date</literal> is "
-"a simple Web Bean! An instance of <literal>Date</literal> may now be "
-"injected by any other Web Bean:"
-msgstr ""
+msgid "And this is all the code we need to declare that <literal>Date</literal> is a simple Web Bean! An instance of <literal>Date</literal> may now be injected by any other Web Bean:"
+msgstr "这个是将<literal>Date</literal> 声明为一个简单web Bean所需的所有代码!现在任何一个 <literal>Date</literal> 实例都可以被任何其他Web Bean注入了:"
#. Tag: programlisting
#: xml.xml:62
#, no-c-format
msgid "<![CDATA[@Current Date date]]>"
-msgstr ""
+msgstr "<![CDATA[@Current Date date]]>"
#. Tag: title
#: xml.xml:67
#, no-c-format
msgid "Declaring Web Bean metadata"
-msgstr ""
+msgstr "声明Web Bean的元数据"
#. Tag: para
#: xml.xml:69
#, no-c-format
-msgid ""
-"We can declare the scope, deployment type and interceptor binding types "
-"using direct child elements of the Web Bean declaration:"
-msgstr ""
+msgid "We can declare the scope, deployment type and interceptor binding types using direct child elements of the Web Bean declaration:"
+msgstr "我们可以直接通过Web Bean声明的子元素来声明范围,部署类型和拦截器绑定类型:"
#. Tag: programlisting
#: xml.xml:72
@@ -168,12 +143,17 @@
" <myfwk:Secure/>\n"
"</myapp:ShoppingCart>]]>"
msgstr ""
+"<![CDATA[<myapp:ShoppingCart>\n"
+" <SessionScoped/>\n"
+" <myfwk:Transactional requiresNew=\"true\"/>\n"
+" <myfwk:Secure/>\n"
+"</myapp:ShoppingCart>]]>"
#. Tag: para
#: xml.xml:74
#, no-c-format
msgid "We use exactly the same approach to specify names and binding type:"
-msgstr ""
+msgstr "我们可以使用相同方法来指定名字和绑定类型:"
#. Tag: programlisting
#: xml.xml:76
@@ -195,14 +175,27 @@
" <Named>systemStartTime</Named>\n"
"</util:Date>]]>"
msgstr ""
+"<![CDATA[<util:Date>\n"
+" <Named>currentTime</Named>\n"
+"</util:Date>\n"
+"\n"
+"<util:Date>\n"
+" <SessionScoped/>\n"
+" <myapp:Login/>\n"
+" <Named>loginTime</Named>\n"
+"</util:Date>\n"
+"\n"
+"<util:Date>\n"
+" <ApplicationScoped/>\n"
+" <myapp:SystemStart/>\n"
+" <Named>systemStartTime</Named>\n"
+"</util:Date>]]>"
#. Tag: para
#: xml.xml:78
#, no-c-format
-msgid ""
-"Where <literal>@Login</literal> and <literal>@SystemStart</literal> are "
-"binding annotations types."
-msgstr ""
+msgid "Where <literal>@Login</literal> and <literal>@SystemStart</literal> are binding annotations types."
+msgstr "<literal>@Login</literal> 和 <literal>@SystemStart</literal> 是绑定注释类型。"
#. Tag: programlisting
#: xml.xml:81
@@ -212,12 +205,15 @@
"@Login Date loginTime;\n"
"@SystemStart Date systemStartTime;]]>"
msgstr ""
+"<![CDATA[@Current Date currentTime;\n"
+"@Login Date loginTime;\n"
+"@SystemStart Date systemStartTime;]]>"
#. Tag: para
#: xml.xml:83
#, no-c-format
msgid "As usual, a Web Bean may support multiple binding types:"
-msgstr ""
+msgstr "通常,一个Web Bean可以支持多个绑定类型:"
#. Tag: programlisting
#: xml.xml:85
@@ -228,14 +224,16 @@
" <myapp:Asynchronous/>\n"
"</myapp:AsynchronousChequePaymentProcessor>]]>"
msgstr ""
+"<![CDATA[<myapp:AsynchronousChequePaymentProcessor>\n"
+" <myapp:PayByCheque/>\n"
+" <myapp:Asynchronous/>\n"
+"</myapp:AsynchronousChequePaymentProcessor>]]>"
#. Tag: para
#: xml.xml:87
#, no-c-format
-msgid ""
-"Interceptors and decorators are just simple Web Beans, so they may be "
-"declared just like any other simple Web Bean:"
-msgstr ""
+msgid "Interceptors and decorators are just simple Web Beans, so they may be declared just like any other simple Web Bean:"
+msgstr "拦截器和装饰器只不过是简单的Web Beans,所以它们可以像其他简单Web Bean一样被声明:"
#. Tag: programlisting
#: xml.xml:90
@@ -246,30 +244,34 @@
" <myfwk:Transactional/>\n"
"</myfwk:TransactionInterceptor>]]>"
msgstr ""
+"<![CDATA[<myfwk:TransactionInterceptor>\n"
+" <Interceptor/>\n"
+" <myfwk:Transactional/>\n"
+"</myfwk:TransactionInterceptor>]]>"
#. Tag: title
#: xml.xml:95
#, no-c-format
msgid "Declaring Web Bean members"
-msgstr ""
+msgstr "声明Web Bean成员"
#. Tag: para
#: xml.xml:97
#, no-c-format
msgid "TODO!"
-msgstr ""
+msgstr "TODO!"
#. Tag: title
#: xml.xml:104
#, no-c-format
msgid "Declaring inline Web Beans"
-msgstr ""
+msgstr "声明内联的Web Beans"
#. Tag: para
#: xml.xml:106
#, no-c-format
msgid "Web Beans lets us define a Web Bean at an injection point. For example:"
-msgstr ""
+msgstr "Web Beans让我们能够在一个注入点定义一个Web Bean。例如:"
#. Tag: programlisting
#: xml.xml:108
@@ -286,42 +288,40 @@
" </myapp:admin>\n"
"</myapp:System>]]>"
msgstr ""
+"<![CDATA[<myapp:System>\n"
+" <ApplicationScoped/>\n"
+" <myapp:admin>\n"
+" <myapp:Name>\n"
+" <myapp:firstname>Gavin</myapp:firstname>\n"
+" <myapp:lastname>King</myapp:lastname>\n"
+" <myapp:email>gavin(a)hibernate.org</myapp:email>\n"
+" </myapp:Name>\n"
+" </myapp:admin>\n"
+"</myapp:System>]]>"
#. Tag: para
#: xml.xml:110
#, no-c-format
-msgid ""
-"The <literal><Name></literal> element declares a simple Web Bean of "
-"scope <literal>@Dependent</literal> and class <literal>Name</literal>, with "
-"a set of initial field values. This Web Bean has a special, container-"
-"generated binding and is therefore injectable only to the specific injection "
-"point at which it is declared."
-msgstr ""
+msgid "The <literal><Name></literal> element declares a simple Web Bean of scope <literal>@Dependent</literal> and class <literal>Name</literal>, with a set of initial field values. This Web Bean has a special, container-generated binding and is therefore injectable only to the specific injection point at which it is declared."
+msgstr " <literal><Name></literal> 元素声明了一个范围为 <literal>@Dependent</literal> ,类为 <literal>Name</literal> 的一个简单的Web Bean,并且设置了一套初始的域值。这个Web Bean有一个特殊的,容器生成的绑定,因此只能在它声明的特定注入点被注入。"
#. Tag: para
#: xml.xml:116
#, no-c-format
-msgid ""
-"This simple but powerful feature allows the Web Beans XML format to be used "
-"to specify whole graphs of Java objects. It's not quite a full databinding "
-"solution, but it's close!"
-msgstr ""
+msgid "This simple but powerful feature allows the Web Beans XML format to be used to specify whole graphs of Java objects. It's not quite a full databinding solution, but it's close!"
+msgstr "这个简单但是很强大的特性能够让我们使用Web Bean XML配置格式来指定整个Java类的图。这并不是完整的数据绑定方案,但是它很接近了!"
#. Tag: title
#: xml.xml:123
#, no-c-format
msgid "Using a schema"
-msgstr ""
+msgstr "使用一个模式"
#. Tag: para
#: xml.xml:125
#, no-c-format
-msgid ""
-"If we want our XML document format to be authored by people who aren't Java "
-"developers, or who don't have access to our code, we need to provide a "
-"schema. There's nothing specific to Web Beans about writing or using the "
-"schema."
-msgstr ""
+msgid "If we want our XML document format to be authored by people who aren't Java developers, or who don't have access to our code, we need to provide a schema. There's nothing specific to Web Beans about writing or using the schema."
+msgstr "如果我们希望我们的XML文档格式由非Java开发者或者没有权限访问我们代码的人来制定,我们需要提供一个模式。在Web Beans中使用模式没有什么特殊的地方。"
#. Tag: programlisting
#: xml.xml:130
@@ -330,10 +330,8 @@
"<![CDATA[<WebBeans xmlns=\"urn:java:javax.webbeans\"\n"
" xmlns:myapp=\"urn:java:com.mydomain.myapp\"\n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-" xsi:schemaLocation=\"urn:java:javax.webbeans http://java.sun.com/"
-"jee/web-beans-1.0.xsd\n"
-" urn:java:com.mydomain.myapp http://mydomain."
-"com/xsd/myapp-1.2.xsd\">\n"
+" xsi:schemaLocation=\"urn:java:javax.webbeans http://java.sun.com/jee/web-beans-1.0.xsd\n"
+" urn:java:com.mydomain.myapp http://mydomain.com/xsd/myapp-1.2.xsd\">\n"
"\n"
" <myapp:System>\n"
" ...\n"
@@ -341,12 +339,21 @@
"\n"
"</WebBeans>]]>"
msgstr ""
+"<![CDATA[<WebBeans xmlns=\"urn:java:javax.webbeans\"\n"
+" xmlns:myapp=\"urn:java:com.mydomain.myapp\"\n"
+" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
+" xsi:schemaLocation=\"urn:java:javax.webbeans http://java.sun.com/jee/web-beans-1.0.xsd\n"
+" urn:java:com.mydomain.myapp http://mydomain.com/xsd/myapp-1.2.xsd\">\n"
+"\n"
+" <myapp:System>\n"
+" ...\n"
+" </myapp:System>\n"
+"\n"
+"</WebBeans>]]>"
#. Tag: para
#: xml.xml:132
#, no-c-format
-msgid ""
-"Writing an XML schema is quite tedious. Therefore, the Web Beans RI project "
-"will provide a tool which automatically generates the XML schema from "
-"compiled Java code."
-msgstr ""
+msgid "Writing an XML schema is quite tedious. Therefore, the Web Beans RI project will provide a tool which automatically generates the XML schema from compiled Java code."
+msgstr "编写一个XML模式相当繁琐。因此,Web Bean的参考实现项目提供了一个工具,可以从编译好的Java代码中自动化生成XML模式。"
+
15 years, 10 months