Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 79E6C7F44 for ; Wed, 12 Oct 2011 16:03:02 +0000 (UTC) Received: (qmail 89939 invoked by uid 500); 12 Oct 2011 16:03:01 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 89878 invoked by uid 500); 12 Oct 2011 16:03:00 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 89871 invoked by uid 99); 12 Oct 2011 16:03:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Oct 2011 16:03:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Oct 2011 16:02:59 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7381823888FE for ; Wed, 12 Oct 2011 16:02:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1182455 - in /cxf/trunk/services/wsn: wsn-core/src/main/java/org/apache/cxf/wsn/ wsn-core/src/main/java/org/apache/cxf/wsn/util/ wsn-osgi/ wsn-osgi/src/main/java/ wsn-osgi/src/main/java/org/ wsn-osgi/src/main/java/org/apache/ wsn-osgi/src/... Date: Wed, 12 Oct 2011 16:02:39 -0000 To: commits@cxf.apache.org From: gnodet@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111012160239.7381823888FE@eris.apache.org> Author: gnodet Date: Wed Oct 12 16:02:38 2011 New Revision: 1182455 URL: http://svn.apache.org/viewvc?rev=1182455&view=rev Log: Minimize dependencies for OSGi Added: cxf/trunk/services/wsn/wsn-osgi/src/main/java/ cxf/trunk/services/wsn/wsn-osgi/src/main/java/org/ cxf/trunk/services/wsn/wsn-osgi/src/main/java/org/apache/ cxf/trunk/services/wsn/wsn-osgi/src/main/java/org/apache/cxf/ cxf/trunk/services/wsn/wsn-osgi/src/main/java/org/apache/cxf/common/ cxf/trunk/services/wsn/wsn-osgi/src/main/java/org/apache/cxf/common/logging/ cxf/trunk/services/wsn/wsn-osgi/src/main/java/org/apache/cxf/common/logging/LogUtils.java Modified: cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/AbstractCreatePullPoint.java cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/util/IdGenerator.java cxf/trunk/services/wsn/wsn-osgi/pom.xml Modified: cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/AbstractCreatePullPoint.java URL: http://svn.apache.org/viewvc/cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/AbstractCreatePullPoint.java?rev=1182455&r1=1182454&r2=1182455&view=diff ============================================================================== --- cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/AbstractCreatePullPoint.java (original) +++ cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/AbstractCreatePullPoint.java Wed Oct 12 16:02:38 2011 @@ -18,7 +18,6 @@ */ package org.apache.cxf.wsn; -import java.util.Iterator; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; @@ -29,10 +28,7 @@ import javax.jws.WebParam; import javax.jws.WebResult; import javax.jws.WebService; -import org.w3c.dom.Element; - import org.apache.cxf.common.logging.LogUtils; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.wsn.util.IdGenerator; import org.oasis_open.docs.wsn.b_2.CreatePullPointResponse; import org.oasis_open.docs.wsn.b_2.UnableToCreatePullPointFaultType; @@ -113,20 +109,7 @@ public abstract class AbstractCreatePull } protected String createPullPointName(org.oasis_open.docs.wsn.b_2.CreatePullPoint createPullPointRequest) { - // Let the creator decide which pull point name to use - String name = null; - for (Iterator it = createPullPointRequest.getAny().iterator(); it.hasNext();) { - Element el = (Element) it.next(); - if ("name".equals(el.getLocalName()) - && "http://cxf.apache.org/wsn2005/1.0".equals(el.getNamespaceURI())) { - name = DOMUtils.getContent(el).trim(); - } - } - if (name == null) { - // If no name is given, just generate one - name = idGenerator.generateSanitizedId(); - } - return name; + return idGenerator.generateSanitizedId(); } public void destroyPullPoint(String address) throws UnableToDestroyPullPointFault { Modified: cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/util/IdGenerator.java URL: http://svn.apache.org/viewvc/cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/util/IdGenerator.java?rev=1182455&r1=1182454&r2=1182455&view=diff ============================================================================== --- cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/util/IdGenerator.java (original) +++ cxf/trunk/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/util/IdGenerator.java Wed Oct 12 16:02:38 2011 @@ -21,9 +21,10 @@ package org.apache.cxf.wsn.util; import java.net.InetAddress; import java.net.ServerSocket; +import java.util.logging.Level; +import java.util.logging.Logger; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.apache.cxf.common.logging.LogUtils; /** * Generator for Globally unique Strings. @@ -31,7 +32,7 @@ import org.apache.commons.logging.LogFac public class IdGenerator { - private static final Log LOG = LogFactory.getLog(IdGenerator.class); + private static final Logger LOGGER = LogUtils.getL7dLogger(IdGenerator.class); private static final String UNIQUE_STUB; @@ -79,7 +80,7 @@ public class IdGenerator { Thread.sleep(100); ss.close(); } catch (Exception ioe) { - LOG.warn("Could not generate unique stub", ioe); + LOGGER.log(Level.WARNING, "Could not generate unique stub", ioe); } } else { hostName = "localhost"; Modified: cxf/trunk/services/wsn/wsn-osgi/pom.xml URL: http://svn.apache.org/viewvc/cxf/trunk/services/wsn/wsn-osgi/pom.xml?rev=1182455&r1=1182454&r2=1182455&view=diff ============================================================================== --- cxf/trunk/services/wsn/wsn-osgi/pom.xml (original) +++ cxf/trunk/services/wsn/wsn-osgi/pom.xml Wed Oct 12 16:02:38 2011 @@ -37,6 +37,12 @@ org.apache.cxf.services.wsn cxf-services-wsn-core ${project.version} + + + org.apache.cxf + cxf-common-utilities + + @@ -52,6 +58,10 @@ org.apache.activemq.activemq-core + !org.apache.cxf.*, + !org.apache.activemq*, + !org.apache.log4j.*, + !org.slf4j.*, javax.xml.bind*;version="[0.0,3)", javax.jws*;version="[0.0,3)", javax.xml.ws*;version="[0.0,3)", @@ -63,7 +73,8 @@ org.apache.cxf.wsn.client;version=${project.version} - org.apache.cxf.wsn.* + org.apache.cxf.wsn.*, + org.apache.cxf.common.logging * <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@))) Added: cxf/trunk/services/wsn/wsn-osgi/src/main/java/org/apache/cxf/common/logging/LogUtils.java URL: http://svn.apache.org/viewvc/cxf/trunk/services/wsn/wsn-osgi/src/main/java/org/apache/cxf/common/logging/LogUtils.java?rev=1182455&view=auto ============================================================================== --- cxf/trunk/services/wsn/wsn-osgi/src/main/java/org/apache/cxf/common/logging/LogUtils.java (added) +++ cxf/trunk/services/wsn/wsn-osgi/src/main/java/org/apache/cxf/common/logging/LogUtils.java Wed Oct 12 16:02:38 2011 @@ -0,0 +1,36 @@ +/** + * 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.cxf.common.logging; + +import java.util.logging.Logger; + +/** + * Simple replacement class for CXF logging utility. + * When deployed in OSGi, projects such as pax-logging can be used to redirect easily + * JUL to another framework such as log4j. + */ +public final class LogUtils { + + private LogUtils() { } + + public static Logger getL7dLogger(Class cls) { + return Logger.getLogger(cls.getName(), null); //NOPMD + } + +}