You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2012/01/11 08:49:04 UTC
svn commit: r1229918 - in /geronimo/server/trunk:
assemblies/geronimo-tomcat7-javaee6/ framework/features/framework/
framework/features/framework/src/main/feature/
framework/modules/geronimo-pax-logging/
framework/modules/geronimo-pax-logging/src/main/...
Author: djencks
Date: Wed Jan 11 07:49:03 2012
New Revision: 1229918
URL: http://svn.apache.org/viewvc?rev=1229918&view=rev
Log:
GERONIMO-6259 don't try to mess up pax logging so hard
Added:
geronimo/server/trunk/framework/features/framework/src/main/feature/
geronimo/server/trunk/framework/features/framework/src/main/feature/feature.xml (with props)
geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/resources/
geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/resources/OSGI-INF/
geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/resources/OSGI-INF/blueprint/
geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/resources/OSGI-INF/blueprint/geronimo-pax-logging.xml (with props)
Removed:
geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/LoggingServiceActivator.java
geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/OSGiLog4jService.java
Modified:
geronimo/server/trunk/assemblies/geronimo-tomcat7-javaee6/pom.xml
geronimo/server/trunk/framework/features/framework/pom.xml
geronimo/server/trunk/framework/modules/geronimo-pax-logging/pom.xml
geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java
geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java
geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/OSGILogServiceWrapper.java
geronimo/server/trunk/plugins/axis2/axis2/src/main/history/dependencies.xml
geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java
geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/KernelManagementHelper.java
Modified: geronimo/server/trunk/assemblies/geronimo-tomcat7-javaee6/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/assemblies/geronimo-tomcat7-javaee6/pom.xml?rev=1229918&r1=1229917&r2=1229918&view=diff
==============================================================================
--- geronimo/server/trunk/assemblies/geronimo-tomcat7-javaee6/pom.xml (original)
+++ geronimo/server/trunk/assemblies/geronimo-tomcat7-javaee6/pom.xml Wed Jan 11 07:49:03 2012
@@ -96,6 +96,7 @@
<feature>obr</feature>
<feature>framework</feature>
<feature>org.apache.geronimo.javaee-specs</feature>
+ <feature>org.apache.karaf.scr.feature</feature>
</startupFeatures>
</configuration>
</plugin>
Modified: geronimo/server/trunk/framework/features/framework/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/features/framework/pom.xml?rev=1229918&r1=1229917&r2=1229918&view=diff
==============================================================================
--- geronimo/server/trunk/framework/features/framework/pom.xml (original)
+++ geronimo/server/trunk/framework/features/framework/pom.xml Wed Jan 11 07:49:03 2012
@@ -260,9 +260,9 @@
<dependencies>
<dependency>
- <groupId>org.apache.geronimo.framework.features</groupId>
- <artifactId>declarative-services</artifactId>
- <version>${project.version}</version>
+ <groupId>org.apache.karaf.scr</groupId>
+ <artifactId>org.apache.karaf.scr.feature</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
<type>xml</type>
<classifier>features</classifier>
</dependency>
Added: geronimo/server/trunk/framework/features/framework/src/main/feature/feature.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/features/framework/src/main/feature/feature.xml?rev=1229918&view=auto
==============================================================================
--- geronimo/server/trunk/framework/features/framework/src/main/feature/feature.xml (added)
+++ geronimo/server/trunk/framework/features/framework/src/main/feature/feature.xml Wed Jan 11 07:49:03 2012
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+
+ 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.
+-->
+
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="framework">
+ <feature description="Geronimo Assemblies :: Karaf Boilerplate Framework" name="framework">
+ <details>Apache Geronimo, the JavaEE server project of the Apache Software Foundation.</details>
+ <bundle start-level="8">mvn:org.apache.geronimo.framework/geronimo-pax-logging/${project.version}</bundle>
+ </feature>
+</features>
Propchange: geronimo/server/trunk/framework/features/framework/src/main/feature/feature.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/framework/features/framework/src/main/feature/feature.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/framework/features/framework/src/main/feature/feature.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: geronimo/server/trunk/framework/modules/geronimo-pax-logging/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-pax-logging/pom.xml?rev=1229918&r1=1229917&r2=1229918&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-pax-logging/pom.xml (original)
+++ geronimo/server/trunk/framework/modules/geronimo-pax-logging/pom.xml Wed Jan 11 07:49:03 2012
@@ -41,17 +41,12 @@
<artifactId>pax-logging-api</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.apache.geronimo.framework</groupId>
- <artifactId>geronimo-main</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.configadmin</artifactId>
- <scope>provided</scope>
- </dependency>
+ <!--<dependency>-->
+ <!--<groupId>org.apache.geronimo.framework</groupId>-->
+ <!--<artifactId>geronimo-main</artifactId>-->
+ <!--<version>${project.version}</version>-->
+ <!--<scope>provided</scope>-->
+ <!--</dependency>-->
</dependencies>
<build>
@@ -61,22 +56,8 @@
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
- <!--<Import-Package>-->
- <!--com.*;resolution:=optional,-->
- <!--javax.xml.*,-->
- <!--javax.*;resolution:=optional,-->
-
- <!--org.knopflerfish.service.log;provider=paxlogging;version="[1.1.0,2.0.0)",-->
- <!--org.ops4j.pax.logging;version="[0.9.5,2.0.0)",-->
- <!--org.osgi.framework;version="[1.0.0,2.0.0)",-->
- <!--org.osgi.service.cm;version="[1.0.0,2.0.0)",-->
- <!--org.osgi.service.event;version="[1.0.0,2.0.0)";resolution:=optional,-->
- <!--org.osgi.service.log;version="[1.3.0,2.0.0)",-->
- <!--org.osgi.util.tracker;version="[1.3.0,2.0.0)",-->
-
- <!--*-->
- <!--</Import-Package>-->
-
+ <Fragment-Host>org.ops4j.pax.logging.pax-logging-service</Fragment-Host>
+ <Import-Package>!*</Import-Package>
<Export-Package>
org.apache.geronimo.logging
</Export-Package>
Modified: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java?rev=1229918&r1=1229917&r2=1229918&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/SystemLog.java Wed Jan 11 07:49:03 2012
@@ -31,12 +31,12 @@ public interface SystemLog {
/**
* Gets the name of the file that configures the log system
*/
- String getConfigFileName();
+// String getConfigFileName();
/**
* Sets the name of the file that the log system should configure itself from.
*/
- void setConfigFileName(String fileName);
+// void setConfigFileName(String fileName);
/**
* Gets the name of the log level used for the root logger.
@@ -52,13 +52,13 @@ public interface SystemLog {
* Indicates how often the log system should check to see if its
* configuration file has been updated.
*/
- int getRefreshPeriodSeconds();
+// int getRefreshPeriodSeconds();
/**
* Sets how often the log system should check to see if its
* configuration file has been updated.
*/
- void setRefreshPeriodSeconds(int seconds);
+// void setRefreshPeriodSeconds(int seconds);
/**
* Gets the name of all log files used by this log system. Typically there
Modified: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java?rev=1229918&r1=1229917&r2=1229918&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/java/org/apache/geronimo/logging/impl/Log4jService.java Wed Jan 11 07:49:03 2012
@@ -20,25 +20,19 @@ package org.apache.geronimo.logging.impl
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.Reader;
-import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.LinkedList;
import java.util.List;
-import java.util.Properties;
-import java.util.Timer;
-import java.util.TimerTask;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
+//import org.apache.felix.scr.annotations.Component;
+//import org.apache.felix.scr.annotations.Service;
import org.apache.geronimo.logging.SystemLog;
-import org.apache.geronimo.main.ServerInfo;
import org.apache.log4j.FileAppender;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
@@ -49,7 +43,10 @@ import org.apache.log4j.Logger;
*
* @version $Rev$ $Date$
*/
-public abstract class Log4jService implements SystemLog {
+
+//@Component(immediate = true)
+//@Service
+public class Log4jService implements SystemLog {
// A substitution variable in the file path in the config file
private final static Pattern VARIABLE_PATTERN = Pattern.compile("\\$\\{.*?\\}");
// Next 6 are patterns that identify log messages in our default format
@@ -69,60 +66,6 @@ public abstract class Log4jService imple
private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Log4jService.class);
- public static final String LOG4JSERVICE_CONFIG_PROPERTY = "org.apache.geronimo.log4jservice.configuration";
-
- /**
- * The URL to the configuration file.
- */
- private String configurationFile;
-
- /**
- * The time (in seconds) between checking for new config.
- */
- private int refreshPeriod;
-
- /**
- * The properties service
- */
- private final ServerInfo serverInfo;
-
- /**
- * The URL watch timer (in daemon mode).
- */
- private Timer timer = new Timer(true);
-
- /**
- * A monitor to check when the config URL changes.
- */
- private TimerTask monitor;
-
- /**
- * Last time the file was changed.
- */
- private long lastChanged = -1;
-
- /**
- * Is this service running?
- */
- private boolean running = false;
-
- /**
- * Construct a <code>Log4jService</code>.
- *
- * @param configurationFile The log4j configuration file.
- * @param refreshPeriod The refresh refreshPeriod (in seconds).
- */
- public Log4jService(String configurationFile, int refreshPeriod, ServerInfo serverInfo) {
- this.refreshPeriod = refreshPeriod;
- this.configurationFile = configurationFile;
- this.serverInfo = serverInfo;
- try {
- Logger.getLogger(this.getClass().getName()).setLevel(Level.INFO);
- } catch (Throwable e) {
- e.printStackTrace();
- }
- }
-
/**
* Gets the level of the root logger.
*/
@@ -206,136 +149,136 @@ public abstract class Log4jService imple
Logger.getLogger(logger).setLevel(Level.toLevel(level));
}
- /**
- * Get the refresh period.
- *
- * @return the refresh period (in seconds)
- */
- public synchronized int getRefreshPeriodSeconds() {
- return refreshPeriod;
- }
-
- /**
- * Set the refresh period.
- *
- * @param period the refresh period (in seconds)
- * @throws IllegalArgumentException if refresh period is < 5
- */
- public synchronized void setRefreshPeriodSeconds(final int period) {
- if (period < 5) {
- throw new IllegalArgumentException("Refresh period must be at least 5 seconds");
- }
-
- if (this.refreshPeriod != period) {
- this.refreshPeriod = period;
- schedule();
- }
- }
-
- /**
- * Get the logging configuration URL.
- *
- * @return the logging configuration URL
- */
- public synchronized String getConfigFileName() {
- return configurationFile;
- }
-
- /**
- * Set the logging configuration URL.
- *
- * @param configurationFile the logging configuration file
- */
- public synchronized void setConfigFileName(final String configurationFile) {
- if (configurationFile == null) {
- throw new IllegalArgumentException("configurationFile is null");
- }
-
- log.debug("Using configuration file: {}", configurationFile);
-
- // ensure that the file name has really been updated
- if (!this.configurationFile.equals(configurationFile)) {
- this.configurationFile = configurationFile;
- lastChanged = -1;
- reconfigure();
- }
- }
-
- /**
- * Get the content of logging configuration file.
- *
- * @return the content of logging configuration file
- */
- public synchronized String getConfiguration() {
- File file = resolveConfigurationFile();
- if (file == null || !file.canRead()) {
- return null;
- }
- Reader in = null;
- try {
- StringBuilder configuration = new StringBuilder();
- in = new InputStreamReader(new FileInputStream(file));
- char[] buffer = new char[4096];
- for (int size = in.read(buffer); size >= 0; size = in.read(buffer)) {
- configuration.append(buffer, 0, size);
- }
- return configuration.toString();
- } catch (IOException e) {
- e.printStackTrace();
- } finally {
- if (in != null) {
- try {
- in.close();
- } catch (IOException e1) {
- e1.printStackTrace();
- }
- }
- }
- return null;
- }
-
- /**
- * Overwrites the content of logging configuration file.
- *
- * @param configuration the new content of logging configuration file
- */
- public synchronized void setConfiguration(final String configuration) throws IOException {
- if (configuration == null || configuration.length() == 0) {
- throw new IllegalArgumentException("configuration is null or an empty string");
- }
-
- File file = resolveConfigurationFile();
- if (file == null) {
- throw new IllegalStateException("Configuration file is null");
- }
-
- // make parent directory if necessary
- if (!file.getParentFile().exists()) {
- if (!file.getParentFile().mkdirs()) {
- throw new IllegalStateException("Could not create parent directory of log configuration file: " + file.getParent());
- }
- }
+// /**
+// * Get the refresh period.
+// *
+// * @return the refresh period (in seconds)
+// */
+// public synchronized int getRefreshPeriodSeconds() {
+// return refreshPeriod;
+// }
+//
+// /**
+// * Set the refresh period.
+// *
+// * @param period the refresh period (in seconds)
+// * @throws IllegalArgumentException if refresh period is < 5
+// */
+// public synchronized void setRefreshPeriodSeconds(final int period) {
+// if (period < 5) {
+// throw new IllegalArgumentException("Refresh period must be at least 5 seconds");
+// }
+//
+// if (this.refreshPeriod != period) {
+// this.refreshPeriod = period;
+// schedule();
+// }
+// }
- // verify that the file is writable or does not exist
- if (file.exists() && !file.canWrite()) {
- throw new IllegalStateException("Configuration file is not writable: " + file.getAbsolutePath());
- }
+// /**
+// * Get the logging configuration URL.
+// *
+// * @return the logging configuration URL
+// */
+// public synchronized String getConfigFileName() {
+// return configurationFile;
+// }
+//
+// /**
+// * Set the logging configuration URL.
+// *
+// * @param configurationFile the logging configuration file
+// */
+// public synchronized void setConfigFileName(final String configurationFile) {
+// if (configurationFile == null) {
+// throw new IllegalArgumentException("configurationFile is null");
+// }
+//
+// log.debug("Using configuration file: {}", configurationFile);
+//
+// // ensure that the file name has really been updated
+// if (!this.configurationFile.equals(configurationFile)) {
+// this.configurationFile = configurationFile;
+// lastChanged = -1;
+// reconfigure();
+// }
+// }
- OutputStream out = null;
- try {
- out = new FileOutputStream(file);
- out.write(configuration.getBytes());
- log.info("Updated configuration file: {}", file);
- } finally {
- if (out != null) {
- try {
- out.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- }
+// /**
+// * Get the content of logging configuration file.
+// *
+// * @return the content of logging configuration file
+// */
+// public synchronized String getConfiguration() {
+// File file = resolveConfigurationFile();
+// if (file == null || !file.canRead()) {
+// return null;
+// }
+// Reader in = null;
+// try {
+// StringBuilder configuration = new StringBuilder();
+// in = new InputStreamReader(new FileInputStream(file));
+// char[] buffer = new char[4096];
+// for (int size = in.read(buffer); size >= 0; size = in.read(buffer)) {
+// configuration.append(buffer, 0, size);
+// }
+// return configuration.toString();
+// } catch (IOException e) {
+// e.printStackTrace();
+// } finally {
+// if (in != null) {
+// try {
+// in.close();
+// } catch (IOException e1) {
+// e1.printStackTrace();
+// }
+// }
+// }
+// return null;
+// }
+//
+// /**
+// * Overwrites the content of logging configuration file.
+// *
+// * @param configuration the new content of logging configuration file
+// */
+// public synchronized void setConfiguration(final String configuration) throws IOException {
+// if (configuration == null || configuration.length() == 0) {
+// throw new IllegalArgumentException("configuration is null or an empty string");
+// }
+//
+// File file = resolveConfigurationFile();
+// if (file == null) {
+// throw new IllegalStateException("Configuration file is null");
+// }
+//
+// // make parent directory if necessary
+// if (!file.getParentFile().exists()) {
+// if (!file.getParentFile().mkdirs()) {
+// throw new IllegalStateException("Could not create parent directory of log configuration file: " + file.getParent());
+// }
+// }
+//
+// // verify that the file is writable or does not exist
+// if (file.exists() && !file.canWrite()) {
+// throw new IllegalStateException("Configuration file is not writable: " + file.getAbsolutePath());
+// }
+//
+// OutputStream out = null;
+// try {
+// out = new FileOutputStream(file);
+// out.write(configuration.getBytes());
+// log.info("Updated configuration file: {}", file);
+// } finally {
+// if (out != null) {
+// try {
+// out.close();
+// } catch (IOException e) {
+// e.printStackTrace();
+// }
+// }
+// }
+// }
public synchronized String[] getLogFileNames() {
List list = new ArrayList();
@@ -506,119 +449,4 @@ public abstract class Log4jService imple
return searchFile(file, minLevel, textPattern, firstLine, lastLine, maxResults, includeStackTraces);
}
- /**
- * Force the logging system to reconfigure.
- */
- public void reconfigure() {
-// File file = resolveConfigurationFile();
-// if (file == null || !file.exists()) {
-// return;
-// } else {
-// log.debug("Reconfiguring from: {}", configurationFile);
-// lastChanged = file.lastModified();
-// }
-//
-// try {
-// FileInputStream in = new FileInputStream(file);
-// Properties props = new Properties();
-// try {
-// props.load(in);
-// } finally {
-// try { in.close(); } catch (IOException ignore) {}
-// }
-//
-// update(props);
-// } catch (Exception e) {
-// e.printStackTrace();
-// }
- }
-
- abstract protected void update(Properties properties) throws Exception;
-
- private synchronized void schedule() {
- if (timer != null) {
- // kill the old monitor
- if (monitor != null) {
- monitor.cancel();
- }
-
- // start the new one
- monitor = new URLMonitorTask();
- TimerTask task = monitor;
- timer.schedule(monitor, 1000 * refreshPeriod, 1000 * refreshPeriod);
- task.run();
- }
- }
-
- public synchronized void start() {
- reconfigure();
-
- timer = new Timer(true);
-
- // Periodically check the configuration file
- schedule();
-
- log.info("----------------------------------------------");
- log.info("Started Logging Service");
-
- log.debug("Log4jService created with configFileName={}, refreshPeriodSeconds={}", configurationFile, refreshPeriod);
-
- running = true;
- }
-
- public synchronized void stop() {
- running = false;
- if (monitor != null) {
- monitor.cancel();
- monitor = null;
- }
- if (timer != null) {
- timer.cancel();
- timer = null;
- }
-
- log.info("Stopping Logging Service");
- log.info("----------------------------------------------");
-
- try {
- LogManager.shutdown();
- } catch (Throwable e) {
- log.info("could not shut down LogManager", e);
- }
- }
-
- private synchronized File resolveConfigurationFile() {
- try {
- return serverInfo.resolveServer(configurationFile);
- } catch (Exception e) {
- return null;
- }
- }
-
- private class URLMonitorTask extends TimerTask {
- public void run() {
- try {
- long lastModified;
- synchronized (this) {
- if (running == false) {
- return;
- }
-
- File file = resolveConfigurationFile();
- if (file == null) {
- return;
- }
-
- lastModified = file.lastModified();
- }
-
- if (lastChanged < lastModified) {
- lastChanged = lastModified;
- reconfigure();
- }
- } catch (Exception e) {
- }
- }
- }
-
}
Added: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/resources/OSGI-INF/blueprint/geronimo-pax-logging.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/resources/OSGI-INF/blueprint/geronimo-pax-logging.xml?rev=1229918&view=auto
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/resources/OSGI-INF/blueprint/geronimo-pax-logging.xml (added)
+++ geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/resources/OSGI-INF/blueprint/geronimo-pax-logging.xml Wed Jan 11 07:49:03 2012
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy">
+
+ <bean id="Log4jService" class="org.apache.geronimo.logging.impl.Log4jService"/>
+
+ <service ref="Log4jService"
+ interface="org.apache.geronimo.logging.SystemLog"/>
+
+</blueprint>
Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/resources/OSGI-INF/blueprint/geronimo-pax-logging.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/resources/OSGI-INF/blueprint/geronimo-pax-logging.xml
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/server/trunk/framework/modules/geronimo-pax-logging/src/main/resources/OSGI-INF/blueprint/geronimo-pax-logging.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/OSGILogServiceWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/OSGILogServiceWrapper.java?rev=1229918&r1=1229917&r2=1229918&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/OSGILogServiceWrapper.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/logging/OSGILogServiceWrapper.java Wed Jan 11 07:49:03 2012
@@ -17,94 +17,59 @@
package org.apache.geronimo.system.logging;
-import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.gbean.annotation.ParamAttribute;
import org.apache.geronimo.gbean.annotation.ParamSpecial;
import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.geronimo.gbean.wrapper.AbstractServiceWrapper;
import org.apache.geronimo.logging.SystemLog;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
+import org.osgi.framework.Bundle;
/**
* @version $Rev$ $Date$
*/
-public class OSGILogServiceWrapper implements SystemLog, GBeanLifecycle {
+public class OSGILogServiceWrapper extends AbstractServiceWrapper<SystemLog> implements SystemLog {
- private SystemLog wrappedSystemLog;
-
- private String filter;
-
- private BundleContext bundleContext;
-
- private ServiceReference serviceReference;
-
- public OSGILogServiceWrapper(@ParamSpecial(type = SpecialAttributeType.bundleContext) BundleContext bundleContext, @ParamAttribute(name = "filter") String filter) {
- this.filter = filter;
- this.bundleContext = bundleContext;
+ public OSGILogServiceWrapper(@ParamSpecial(type = SpecialAttributeType.bundle) Bundle bundle) {
+ super(bundle, SystemLog.class);
}
- @Override
- public String getConfigFileName() {
- return wrappedSystemLog.getConfigFileName();
- }
+// @Override
+// public String getConfigFileName() {
+// return get().getConfigFileName();
+// }
@Override
public String[] getLogFileNames() {
- return wrappedSystemLog.getLogFileNames();
+ return get().getLogFileNames();
}
@Override
public SearchResults getMatchingItems(String logFile, Integer firstLine, Integer lastLine, String minLevel, String regex, int maxResults, boolean includeStackTraces) {
- return wrappedSystemLog.getMatchingItems(logFile, firstLine, lastLine, minLevel, regex, maxResults, includeStackTraces);
+ return get().getMatchingItems(logFile, firstLine, lastLine, minLevel, regex, maxResults, includeStackTraces);
}
- @Override
- public int getRefreshPeriodSeconds() {
- return wrappedSystemLog.getRefreshPeriodSeconds();
- }
+// @Override
+// public int getRefreshPeriodSeconds() {
+// return get().getRefreshPeriodSeconds();
+// }
@Override
public String getRootLoggerLevel() {
- return wrappedSystemLog.getRootLoggerLevel();
+ return get().getRootLoggerLevel();
}
- @Override
- public void setConfigFileName(String fileName) {
- wrappedSystemLog.setConfigFileName(fileName);
- }
-
- @Override
- public void setRefreshPeriodSeconds(int seconds) {
- wrappedSystemLog.setRefreshPeriodSeconds(seconds);
- }
+// @Override
+// public void setConfigFileName(String fileName) {
+// get().setConfigFileName(fileName);
+// }
+//
+// @Override
+// public void setRefreshPeriodSeconds(int seconds) {
+// get().setRefreshPeriodSeconds(seconds);
+// }
@Override
public void setRootLoggerLevel(String level) {
- wrappedSystemLog.setRootLoggerLevel(level);
- }
-
- @Override
- public void doFail() {
- stop();
+ get().setRootLoggerLevel(level);
}
- @Override
- public void doStart() throws Exception {
- ServiceReference[] serviceReferences = bundleContext.getServiceReferences(SystemLog.class.getName(), filter);
- if (serviceReferences != null && serviceReferences.length > 0) {
- serviceReference = serviceReferences[0];
- wrappedSystemLog = (SystemLog) bundleContext.getService(serviceReference);
- }
- }
-
- @Override
- public void doStop() throws Exception {
- stop();
- }
-
- private void stop() {
- if (serviceReference != null) {
- bundleContext.ungetService(serviceReference);
- }
- }
}
Modified: geronimo/server/trunk/plugins/axis2/axis2/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/axis2/src/main/history/dependencies.xml?rev=1229918&r1=1229917&r2=1229918&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/axis2/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/axis2/axis2/src/main/history/dependencies.xml Wed Jan 11 07:49:03 2012
@@ -192,6 +192,11 @@
<type>jar</type>
</dependency>
<dependency>
+ <groupId>org.ops4j.pax.logging</groupId>
+ <artifactId>pax-logging-api</artifactId>
+ <type>jar</type>
+ </dependency>
+ <dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.compendium</artifactId>
<type>jar</type>
Modified: geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java?rev=1229918&r1=1229917&r2=1229918&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java (original)
+++ geronimo/server/trunk/plugins/console/console-base-portlets/src/main/java/org/apache/geronimo/console/logmanager/LogManagerPortlet.java Wed Jan 11 07:49:03 2012
@@ -50,14 +50,14 @@ public class LogManagerPortlet extends B
return;
}
SystemLog log = PortletManager.getCurrentSystemLog(renderRequest);
- renderRequest.setAttribute("configFile", log.getConfigFileName());
+// renderRequest.setAttribute("configFile", log.getConfigFileName());
// renderRequest.setAttribute("configuration", LogHelper.getConfiguration());
renderRequest.setAttribute("logLevel", log.getRootLoggerLevel());
- try{
- renderRequest.setAttribute("refreshPeriod", Integer.valueOf(log.getRefreshPeriodSeconds()));
- }catch(NumberFormatException e){
- //ignore
- }
+// try{
+// renderRequest.setAttribute("refreshPeriod", Integer.valueOf(log.getRefreshPeriodSeconds()));
+// }catch(NumberFormatException e){
+// //ignore
+// }
normalView.include(renderRequest, renderRespose);
}
@@ -88,13 +88,13 @@ public class LogManagerPortlet extends B
}catch(NumberFormatException e){
//ignore
}
- if (refreshPeriodInt != log.getRefreshPeriodSeconds()) {
- log.setRefreshPeriodSeconds(refreshPeriodInt);
- }
- }
- if (!log.getConfigFileName().equals(configFile)) {
- log.setConfigFileName(configFile);
+// if (refreshPeriodInt != log.getRefreshPeriodSeconds()) {
+// log.setRefreshPeriodSeconds(refreshPeriodInt);
+// }
}
+// if (!log.getConfigFileName().equals(configFile)) {
+// log.setConfigFileName(configFile);
+// }
if (!currentLevel.equals(logLevel)) {
log.setRootLoggerLevel(logLevel);
}
Modified: geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/KernelManagementHelper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/KernelManagementHelper.java?rev=1229918&r1=1229917&r2=1229918&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/KernelManagementHelper.java (original)
+++ geronimo/server/trunk/plugins/console/console-core/src/main/java/org/apache/geronimo/console/util/KernelManagementHelper.java Wed Jan 11 07:49:03 2012
@@ -399,7 +399,11 @@ public class KernelManagementHelper impl
int i = 0;
for (Iterator it = set.iterator(); it.hasNext();) {
AbstractName name = (AbstractName) it.next();
- result[i++] = kernel.getProxyManager().createProxy(name, iface.getClassLoader());
+ try {
+ result[i++] = kernel.getGBean(name);
+ } catch (GBeanNotFoundException e) {
+ throw new RuntimeException(e);
+ }
}
return result;
}