From 1677ef59deb0e2aa28ce227a2b35405fa7b2f83f Mon Sep 17 00:00:00 2001 From: rfeng Date: Tue, 6 Oct 2009 00:22:26 +0000 Subject: Refactor resource bundles to a package git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@822095 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/assembly/xml/BaseAssemblyProcessor.java | 6 +-- .../sca/assembly/xml/CompositeModelResolver.java | 2 +- .../apache/tuscany/sca/assembly/xml/Messages.java | 27 +++++++++++++ .../xml/DefinitionsDocumentProcessor.java | 2 +- .../tuscany/sca/definitions/xml/Messages.java | 27 +++++++++++++ .../sca/policy/xml/ExtensionTypeProcessor.java | 2 +- .../tuscany/sca/policy/xml/IntentProcessor.java | 4 +- .../apache/tuscany/sca/policy/xml/Messages.java | 27 +++++++++++++ .../tuscany/sca/policy/xml/PolicySetProcessor.java | 4 +- .../assembly-xml-validation-messages.properties | 32 --------------- .../definitions-xml-validation-messages.properties | 22 ----------- .../assembly-xml-validation-messages.properties | 32 +++++++++++++++ .../definitions-xml-validation-messages.properties | 22 +++++++++++ .../xml/policy-xml-validation-messages.properties | 45 ++++++++++++++++++++++ .../policy-xml-validation-messages.properties | 45 ---------------------- .../policy/header/JMSHeaderPolicyProcessor.java | 5 ++- 16 files changed, 193 insertions(+), 111 deletions(-) create mode 100644 java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Messages.java create mode 100644 java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/Messages.java create mode 100644 java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/policy/xml/Messages.java delete mode 100644 java/sca/modules/assembly-xml/src/main/resources/assembly-xml-validation-messages.properties delete mode 100644 java/sca/modules/assembly-xml/src/main/resources/definitions-xml-validation-messages.properties create mode 100644 java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/assembly/xml/assembly-xml-validation-messages.properties create mode 100644 java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/definitions/xml/definitions-xml-validation-messages.properties create mode 100644 java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties delete mode 100644 java/sca/modules/assembly-xml/src/main/resources/policy-xml-validation-messages.properties (limited to 'java/sca') diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java index 4ab1f0c072..e8c555b3c4 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java @@ -154,7 +154,7 @@ abstract class BaseAssemblyProcessor extends BaseStAXArtifactProcessor { if (monitor != null) { Problem problem = monitor.createProblem(this.getClass().getName(), - "assembly-xml-validation-messages", + Messages.RESOURCE_BUNDLE, Severity.WARNING, model, message, @@ -174,7 +174,7 @@ abstract class BaseAssemblyProcessor extends BaseStAXArtifactProcessor { if (monitor != null) { Problem problem = monitor.createProblem(this.getClass().getName(), - "assembly-xml-validation-messages", + Messages.RESOURCE_BUNDLE, Severity.ERROR, model, message, @@ -194,7 +194,7 @@ abstract class BaseAssemblyProcessor extends BaseStAXArtifactProcessor { if (monitor != null) { Problem problem = monitor.createProblem(this.getClass().getName(), - "assembly-xml-validation-messages", + Messages.RESOURCE_BUNDLE, Severity.ERROR, model, message, diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeModelResolver.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeModelResolver.java index b9c6516a68..e9a617b3b6 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeModelResolver.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/CompositeModelResolver.java @@ -54,7 +54,7 @@ public class CompositeModelResolver implements ModelResolver { if (old != null) { Monitor.error(monitor, this, - "assembly-xml-validation-messages", + Messages.RESOURCE_BUNDLE, "DuplicateCompositeName", composite.getName().toString(), contribution.getLocation()); diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Messages.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Messages.java new file mode 100644 index 0000000000..320c4eae62 --- /dev/null +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/Messages.java @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.tuscany.sca.assembly.xml; + +/** + * Constants for resource bundle names + */ +public interface Messages { + String RESOURCE_BUNDLE = "org.apache.tuscany.sca.assembly.xml.assembly-xml-validation-messages"; +} diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java index 3691212960..cfda3dbebc 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsDocumentProcessor.java @@ -85,7 +85,7 @@ public class DefinitionsDocumentProcessor implements URLArtifactProcessor element found. It should appear inside a or element. -UnexpectedBindingElement = Unexpected element found. It should appear inside a or element. -UnexpectedImplementationElement = Unexpected element found. It should appear inside a element. -PolicyImplValidationException = PolicyValidation exception when processing implementation of component {0} due to {1}. -PolicyServiceValidationException = PolicyValidation exceptions when processing service/reference {0} in {1}. Error is {2} -ContributionReadException = ContributionReadException occured due to : {0} -ContributionResolveException = ContributionResolveException occured due to : {0} -ContributionWriteException = ContributionWriteException occured due to : {0} -XMLStreamException = XMLStreamException occured due to : {0} -DuplicateCompositeName = [ASM_6001] More than one composite with the same name {0} found in contribution {1} -IncompatiblePropertyType = [ASM_5036] Component {0} property {1} type is not compatible with implementation property type diff --git a/java/sca/modules/assembly-xml/src/main/resources/definitions-xml-validation-messages.properties b/java/sca/modules/assembly-xml/src/main/resources/definitions-xml-validation-messages.properties deleted file mode 100644 index 857887ec3f..0000000000 --- a/java/sca/modules/assembly-xml/src/main/resources/definitions-xml-validation-messages.properties +++ /dev/null @@ -1,22 +0,0 @@ -# -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# -ContributionReadException = ContributionReadException occured due to : -PrivilegedActionException = Privileged Action Exception occured due to FilePermission in security policy file: \ No newline at end of file diff --git a/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/assembly/xml/assembly-xml-validation-messages.properties b/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/assembly/xml/assembly-xml-validation-messages.properties new file mode 100644 index 0000000000..fe29a3be28 --- /dev/null +++ b/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/assembly/xml/assembly-xml-validation-messages.properties @@ -0,0 +1,32 @@ +# +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# +NoCompositeNamespace = No namespace found: Composite = {0} +UnexpectedInterfaceElement = Unexpected element found. It should appear inside a or element. +UnexpectedBindingElement = Unexpected element found. It should appear inside a or element. +UnexpectedImplementationElement = Unexpected element found. It should appear inside a element. +PolicyImplValidationException = PolicyValidation exception when processing implementation of component {0} due to {1}. +PolicyServiceValidationException = PolicyValidation exceptions when processing service/reference {0} in {1}. Error is {2} +ContributionReadException = ContributionReadException occured due to : {0} +ContributionResolveException = ContributionResolveException occured due to : {0} +ContributionWriteException = ContributionWriteException occured due to : {0} +XMLStreamException = XMLStreamException occured due to : {0} +DuplicateCompositeName = [ASM_6001] More than one composite with the same name {0} found in contribution {1} +IncompatiblePropertyType = [ASM_5036] Component {0} property {1} type is not compatible with implementation property type diff --git a/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/definitions/xml/definitions-xml-validation-messages.properties b/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/definitions/xml/definitions-xml-validation-messages.properties new file mode 100644 index 0000000000..857887ec3f --- /dev/null +++ b/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/definitions/xml/definitions-xml-validation-messages.properties @@ -0,0 +1,22 @@ +# +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# +ContributionReadException = ContributionReadException occured due to : +PrivilegedActionException = Privileged Action Exception occured due to FilePermission in security policy file: \ No newline at end of file diff --git a/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties b/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties new file mode 100644 index 0000000000..d092b5959a --- /dev/null +++ b/java/sca/modules/assembly-xml/src/main/resources/org/apache/tuscany/sca/policy/xml/policy-xml-validation-messages.properties @@ -0,0 +1,45 @@ +# +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# +ReferredPolicySetNotFound = Referred PolicySet - {0} not found for PolicySet - {1} +MappedIntentNotFound = Mapped Intent - {0} not found for PolicySet {1} +ProvidedIntentNotFound = Provided Intent - {0} not found for PolicySet {1} +UnableToMapPolicies = Unable to map policies for default qualifier in IntentMap for - {0} in policy set - {1} +IntentMapDoesNotMatch = Intent provided by IntentMap {0} does not match parent qualifier {1} in policyset - {2} +IntentNotSpecified = Intent Map provides for Intent not specified as provided by parent PolicySet - {0} +ContrainsAttributeMissing = Constrains attribute missing from Policy Intent Definition {0} +RequiredIntentNotFound = Required Intent - {0} not found for ProfileIntent {1} +QualifiableIntentNotFound = Qualifiable Intent - {0} not found for QualifiedIntent {1} +ErrorInPolicyIntentDefinition = Error in PolicyIntent Definition - {0} {1} +ExcludedIntentNotFound = Excluded Intent {0} not found for intent {1} +UnrecognizedIntentAttachPointType = Unrecognized IntentAttachPointType - {0} +RequiredAttributeMissing = Required attribute {0} missing from extension type definition +AlwaysProvidedIntentNotFound = Always Provided Intent - {0} not found for ExtensionType {1} +MayProvideIntentNotFound = May Provide Intent - {0} not found for ExtensionType {1} +ContributionReadException = ContributionReadException occurred due to: {0} +CyclicReferenceFound = Cyclic reference detected in required attributes of ProfileIntents {0} and {1} +IntentNameMissing = Required attribute "name" missing for Intent Definition +PolicySetReferenceNameMissing = Required attribute "name" missing for PolicySetReference in PolicySet : {0} +PolicySetNameMissing = Required attribute "name" missing for PolicySet Definition +PolicySetAppliesToMissing = Required attribute "appliesTo" missing for PolicySet Definition +IntentMapProvidesMissing = Required attribute "provides" missing for IntentMap in PolicySet : {0} +QualifierNameMissing = Required attribute "name" missing for qualifier definition in PolicySet : {0} +ConstrainedTypeNotFound = Unable to find the extension type {0} constrained by intent: {1} + diff --git a/java/sca/modules/assembly-xml/src/main/resources/policy-xml-validation-messages.properties b/java/sca/modules/assembly-xml/src/main/resources/policy-xml-validation-messages.properties deleted file mode 100644 index d092b5959a..0000000000 --- a/java/sca/modules/assembly-xml/src/main/resources/policy-xml-validation-messages.properties +++ /dev/null @@ -1,45 +0,0 @@ -# -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# -# -ReferredPolicySetNotFound = Referred PolicySet - {0} not found for PolicySet - {1} -MappedIntentNotFound = Mapped Intent - {0} not found for PolicySet {1} -ProvidedIntentNotFound = Provided Intent - {0} not found for PolicySet {1} -UnableToMapPolicies = Unable to map policies for default qualifier in IntentMap for - {0} in policy set - {1} -IntentMapDoesNotMatch = Intent provided by IntentMap {0} does not match parent qualifier {1} in policyset - {2} -IntentNotSpecified = Intent Map provides for Intent not specified as provided by parent PolicySet - {0} -ContrainsAttributeMissing = Constrains attribute missing from Policy Intent Definition {0} -RequiredIntentNotFound = Required Intent - {0} not found for ProfileIntent {1} -QualifiableIntentNotFound = Qualifiable Intent - {0} not found for QualifiedIntent {1} -ErrorInPolicyIntentDefinition = Error in PolicyIntent Definition - {0} {1} -ExcludedIntentNotFound = Excluded Intent {0} not found for intent {1} -UnrecognizedIntentAttachPointType = Unrecognized IntentAttachPointType - {0} -RequiredAttributeMissing = Required attribute {0} missing from extension type definition -AlwaysProvidedIntentNotFound = Always Provided Intent - {0} not found for ExtensionType {1} -MayProvideIntentNotFound = May Provide Intent - {0} not found for ExtensionType {1} -ContributionReadException = ContributionReadException occurred due to: {0} -CyclicReferenceFound = Cyclic reference detected in required attributes of ProfileIntents {0} and {1} -IntentNameMissing = Required attribute "name" missing for Intent Definition -PolicySetReferenceNameMissing = Required attribute "name" missing for PolicySetReference in PolicySet : {0} -PolicySetNameMissing = Required attribute "name" missing for PolicySet Definition -PolicySetAppliesToMissing = Required attribute "appliesTo" missing for PolicySet Definition -IntentMapProvidesMissing = Required attribute "provides" missing for IntentMap in PolicySet : {0} -QualifierNameMissing = Required attribute "name" missing for qualifier definition in PolicySet : {0} -ConstrainedTypeNotFound = Unable to find the extension type {0} constrained by intent: {1} - diff --git a/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/JMSHeaderPolicyProcessor.java b/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/JMSHeaderPolicyProcessor.java index bfa67efa72..fc60c33470 100644 --- a/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/JMSHeaderPolicyProcessor.java +++ b/java/sca/modules/binding-jms/src/main/java/org/apache/tuscany/sca/binding/jms/policy/header/JMSHeaderPolicyProcessor.java @@ -27,6 +27,7 @@ import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; import org.apache.tuscany.sca.assembly.xml.Constants; +import org.apache.tuscany.sca.assembly.xml.Messages; import org.apache.tuscany.sca.contribution.processor.BaseStAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.ContributionReadException; import org.apache.tuscany.sca.contribution.processor.ContributionResolveException; @@ -63,7 +64,7 @@ public class JMSHeaderPolicyProcessor extends BaseStAXArtifactProcessor implemen */ protected void warning(String message, Object model, String... messageParameters) { if (monitor != null){ - Problem problem = monitor.createProblem(this.getClass().getName(), "assembly-xml-validation-messages", Severity.WARNING, model, message, (Object[])messageParameters); + Problem problem = monitor.createProblem(this.getClass().getName(), Messages.RESOURCE_BUNDLE, Severity.WARNING, model, message, (Object[])messageParameters); monitor.problem(problem); } } @@ -77,7 +78,7 @@ public class JMSHeaderPolicyProcessor extends BaseStAXArtifactProcessor implemen */ protected void error(String message, Object model, Object... messageParameters) { if (monitor != null) { - Problem problem = monitor.createProblem(this.getClass().getName(), "assembly-xml-validation-messages", Severity.ERROR, model, message, (Object[])messageParameters); + Problem problem = monitor.createProblem(this.getClass().getName(), Messages.RESOURCE_BUNDLE, Severity.ERROR, model, message, (Object[])messageParameters); monitor.problem(problem); } } -- cgit v1.2.3