summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/policy-logging/src/main
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-07-09 17:11:31 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-07-09 17:11:31 +0000
commite549b5fdded309c9bd4c0ba61bbeec4673bdf883 (patch)
tree4e0958af9d7b6458408b529fc81b924af54d6a2c /java/sca/modules/policy-logging/src/main
parentad7f276b9b4421c7436b7d42b88ee5240b16b4ee (diff)
Update the dependency and change the namespace
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@792609 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/policy-logging/src/main')
-rw-r--r--java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.java8
-rw-r--r--java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyInterceptor.java2
-rw-r--r--java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyProcessor.java7
-rw-r--r--java/sca/modules/policy-logging/src/main/resources/META-INF/definitions.xml31
-rw-r--r--java/sca/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml20
5 files changed, 24 insertions, 44 deletions
diff --git a/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.java b/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.java
index 3bd825afb1..cb2a8b7ee8 100644
--- a/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.java
+++ b/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicy.java
@@ -22,6 +22,8 @@ import java.util.logging.Level;
import javax.xml.namespace.QName;
+import org.apache.tuscany.sca.assembly.Base;
+
/**
* Implementation for policies that could be injected as parameter
* into the axis2config.
@@ -29,9 +31,9 @@ import javax.xml.namespace.QName;
* @version $Rev$ $Date$
*/
public class JDKLoggingPolicy {
- static final String SCA10_NS = "http://www.osoa.org/xmlns/sca/1.0";
- static final String SCA10_TUSCANY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
- private static final QName JDK_LOGGING_POLICY_QNAME = new QName(SCA10_TUSCANY_NS, "jdkLogger");
+ static final String SCA11_NS = Base.SCA11_NS;
+ static final String SCA11_TUSCANY_NS = Base.SCA11_TUSCANY_NS;
+ private static final QName JDK_LOGGING_POLICY_QNAME = new QName(SCA11_TUSCANY_NS, "jdkLogger");
private String loggerName;
private String resourceBundleName;
diff --git a/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyInterceptor.java b/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyInterceptor.java
index 4b5f053c82..fbcb293513 100644
--- a/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyInterceptor.java
+++ b/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyInterceptor.java
@@ -39,7 +39,7 @@ import org.apache.tuscany.sca.policy.PolicySet;
*/
public class JDKLoggingPolicyInterceptor implements PhasedInterceptor {
public static final String loggingPolicy = "JDKLoggingPolicy";
- public static final QName policySetQName = new QName(JDKLoggingPolicy.SCA10_TUSCANY_NS, loggingPolicy);
+ public static final QName policySetQName = new QName(JDKLoggingPolicy.SCA11_TUSCANY_NS, loggingPolicy);
private Logger logger = null;
private Invoker next;
diff --git a/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyProcessor.java b/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyProcessor.java
index 5fd7a37a26..0254da7620 100644
--- a/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyProcessor.java
+++ b/java/sca/modules/policy-logging/src/main/java/org/apache/tuscany/sca/policy/logging/jdk/JDKLoggingPolicyProcessor.java
@@ -41,12 +41,11 @@ import org.apache.tuscany.sca.monitor.Monitor;
* @version $Rev$ $Date$
*/
public class JDKLoggingPolicyProcessor implements StAXArtifactProcessor<JDKLoggingPolicy> {
- private static final QName JDK_LOGGING_POLICY_QNAME = new QName(JDKLoggingPolicy.SCA10_TUSCANY_NS, "jdkLogger");
+ private static final QName JDK_LOGGING_POLICY_QNAME = new QName(JDKLoggingPolicy.SCA11_TUSCANY_NS, "jdkLogger");
private static final String LOG_LEVEL = "logLevel";
private static final String RESOURCE_BUNDLE = "resourceBundle";
private static final String USE_PARENT_HANDLERS = "useParentHandlers";
- private static final String TUSACNY_NS = "http://tuscany.apache.org/xmlns/sca/1.0";
-
+
public QName getArtifactType() {
return JDK_LOGGING_POLICY_QNAME;
}
@@ -101,7 +100,7 @@ public class JDKLoggingPolicyProcessor implements StAXArtifactProcessor<JDKLoggi
writer.writeStartElement(prefix,
JDK_LOGGING_POLICY_QNAME.getLocalPart(),
JDK_LOGGING_POLICY_QNAME.getNamespaceURI());
- writer.writeNamespace("tuscany", JDKLoggingPolicy.SCA10_TUSCANY_NS);
+ writer.writeNamespace("tuscany", JDKLoggingPolicy.SCA11_TUSCANY_NS);
if (policy.getLoggerName() != null) {
writer.writeAttribute("name", policy.getLoggerName());
diff --git a/java/sca/modules/policy-logging/src/main/resources/META-INF/definitions.xml b/java/sca/modules/policy-logging/src/main/resources/META-INF/definitions.xml
deleted file mode 100644
index 46e6d4490a..0000000000
--- a/java/sca/modules/policy-logging/src/main/resources/META-INF/definitions.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="ASCII"?>
-<!--
- * 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.
--->
-<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
- xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
-
- <!-- Policy Intents Defined by the SCA Runtime -->
- <intent name="logging" constrains="sca:implementation sca:binding">
- <description>
- All messages to and from this implementation must be logged
- </description>
- </intent>
-</definitions> \ No newline at end of file
diff --git a/java/sca/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml b/java/sca/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml
index 956a8983a2..d168775f31 100644
--- a/java/sca/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml
+++ b/java/sca/modules/policy-logging/src/main/resources/org/apache/tuscany/sca/policy/logging/definitions.xml
@@ -17,15 +17,25 @@
* specific language governing permissions and limitations
* under the License.
-->
-<definitions xmlns="http://www.osoa.org/xmlns/sca/1.0"
- targetNamespace="http://tuscany.apache.org/xmlns/sca/1.0"
- xmlns:sca="http://www.osoa.org/xmlns/sca/1.0"
- xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0">
+<definitions xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ targetNamespace="http://tuscany.apache.org/xmlns/sca/1.1"
+ xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1">
<!-- Policy Intents Defined by the SCA Runtime -->
- <intent name="logging" constrains="sca:implementation.java sca:implementation.spring">
+ <intent name="logging" constrains="sca:implementation sca:binding">
<description>
All messages to and from this implementation must be logged
</description>
</intent>
+
+ <policySet name="JDKLoggingPolicy"
+ provides="tuscany:logging"
+ appliesTo="sca:binding sca:implementation">
+ <tuscany:jdkLogger name="test.logger">
+ <tuscany:logLevel>INFO</tuscany:logLevel>
+ <tuscany:resourceBundle>Trace_Messages.properties</tuscany:resourceBundle>
+ </tuscany:jdkLogger>
+ </policySet>
+
</definitions> \ No newline at end of file