Skip to content

Commit

Permalink
Merge pull request #1140 from eclipse-passage/1131-2
Browse files Browse the repository at this point in the history
Don't require log4j-core for o.e.passage.lic.base #1131
  • Loading branch information
eparovyshnaya authored Oct 26, 2022
2 parents a7fafef + 260a1c6 commit 70266f3
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 31 deletions.
9 changes: 5 additions & 4 deletions bundles/org.eclipse.passage.lbc.jetty/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.eclipse.passage.lic.net;bundle-version="0.0.0",
org.eclipse.passage.lic.jetty;bundle-version="0.0.0",
org.eclipse.core.runtime;bundle-version="0.0.0",
Require-Bundle: org.eclipse.core.runtime;bundle-version="0.0.0",
org.eclipse.passage.lbc.base;bundle-version="0.0.0",
org.eclipse.passage.lic.equinox;bundle-version="0.0.0",
org.eclipse.passage.lbc.base;bundle-version="0.0.0"
org.eclipse.passage.lic.execute;bundle-version="0.0.0",
org.eclipse.passage.lic.jetty;bundle-version="0.0.0",
org.eclipse.passage.lic.net;bundle-version="0.0.0"
Bundle-ActivationPolicy: lazy
Bundle-Activator: org.eclipse.passage.lbc.internal.jetty.FlsJettyActivator
Export-Package: org.eclipse.passage.lbc.jetty
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.eclipse.passage.lbc.internal.base.api.FloatingStateFromGear;
import org.eclipse.passage.lbc.jetty.FlsCommandScope;
import org.eclipse.passage.lic.equinox.io.FileFromBundle;
import org.eclipse.passage.lic.internal.execute.Logging;
import org.eclipse.passage.lic.internal.jetty.JettyHandler;
import org.eclipse.passage.lic.internal.jetty.interaction.LicensedJettyActivator;
import org.eclipse.passage.lic.internal.net.connect.Storage;
Expand Down Expand Up @@ -47,7 +48,11 @@ protected JettyHandler handler() {
}

@Override
protected InputStream logConfig() throws Exception {
protected void configureLogging() {
new Logging(this::logConfig).configure();
}

private InputStream logConfig() throws Exception {
Bundle bundle = FrameworkUtil.getBundle(getClass());
return new FileFromBundle(bundle, "config/log4j2.xml").get(); //$NON-NLS-1$
}
Expand Down
4 changes: 1 addition & 3 deletions bundles/org.eclipse.passage.lic.base/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ Export-Package: org.eclipse.passage.lic.base,
org.eclipse.passage.lic.internal.base.access;x-internal:=true,
org.eclipse.passage.lic.internal.base.conditions;x-internal:=true,
org.eclipse.passage.lic.internal.base.inspection.hardware;x-friends:="org.eclipse.passage.loc.licenses.core,org.eclipse.passage.lic.oshi",
org.eclipse.passage.lic.internal.base.logging;x-friends:="org.eclipse.passage.lic.jetty",
org.eclipse.passage.lic.internal.base.observatory;x-internal:=true,
org.eclipse.passage.lic.internal.base.requirements;x-internal:=true,
org.eclipse.passage.lic.internal.base.time;x-friends:="org.eclipse.passage.lic.base.tests"
Import-Package: org.apache.logging.log4j;version="2.17.1",
org.apache.logging.log4j.core.config;version="2.17.1"
Import-Package: org.apache.logging.log4j;version="2.17.1"
6 changes: 4 additions & 2 deletions bundles/org.eclipse.passage.lic.execute/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ Require-Bundle: org.eclipse.passage.lic.api;bundle-version="0.0.0",
org.eclipse.passage.lic.licenses;bundle-version="0.0.0",
org.eclipse.passage.lic.licenses.model;bundle-version="0.0.0",
org.eclipse.passage.lic.oshi;bundle-version="0.0.0"
Export-Package: org.eclipse.passage.lic.execute
Import-Package: org.apache.logging.log4j
Export-Package: org.eclipse.passage.lic.execute,
org.eclipse.passage.lic.internal.execute;x-internal:=true
Import-Package: org.apache.logging.log4j;version="2.17.1",
org.apache.logging.log4j.core.config;version="2.17.1"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020, 2021 ArSysOp
* Copyright (c) 2020, 2022 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -8,7 +8,7 @@
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
* ArSysOp - initial API and implementation, further support
*******************************************************************************/
package org.eclipse.passage.lic.execute;

Expand All @@ -24,11 +24,10 @@
import org.eclipse.passage.lic.base.InvalidLicensedProduct;
import org.eclipse.passage.lic.equinox.LicensedApplication;
import org.eclipse.passage.lic.equinox.io.FileFromBundle;
import org.eclipse.passage.lic.internal.base.logging.Logging;
import org.eclipse.passage.lic.internal.execute.Logging;
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;

@SuppressWarnings("restriction")
public final class DefaultFramework extends BaseFramework {

private final Logger log;
Expand Down Expand Up @@ -65,7 +64,7 @@ private InputStream logConfig() throws Exception {
return new FileFromBundle(//
FrameworkUtil.getBundle(getClass()), //
"config/log4j2.xml")//$NON-NLS-1$
.get();
.get();
}

private void logConfiguration() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2021 ArSysOp
* Copyright (c) 2021, 2022 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -8,9 +8,9 @@
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
* ArSysOp - initial API and implementation, further support
*******************************************************************************/
package org.eclipse.passage.lic.internal.base.logging;
package org.eclipse.passage.lic.internal.execute;

import java.io.InputStream;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020, 2021 ArSysOp
* Copyright (c) 2020, 2022 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -8,13 +8,10 @@
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
* ArSysOp - initial API and implementation, further support
*******************************************************************************/
package org.eclipse.passage.lic.internal.jetty.interaction;

import java.io.InputStream;

import org.eclipse.passage.lic.internal.base.logging.Logging;
import org.eclipse.passage.lic.internal.jetty.JettyHandler;
import org.eclipse.passage.lic.internal.jetty.JettyServer;
import org.osgi.framework.BundleActivator;
Expand All @@ -41,9 +38,7 @@ public final void stop(BundleContext context) throws Exception {
server.stop();
}

private void configureLogging() {
new Logging(this::logConfig).configure();
}
protected abstract void configureLogging();

private void registerCommands(BundleContext context) {
Commands commands = new Commands();
Expand All @@ -56,8 +51,6 @@ private void registerCommands(BundleContext context) {

protected abstract JettyHandler handler();

protected abstract InputStream logConfig() throws Exception;

protected abstract void registerCustomCommands(BundleContext context);

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2021 ArSysOp
* Copyright (c) 2021, 2022 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand All @@ -8,7 +8,7 @@
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
* ArSysOp - initial API and implementation, further support
*******************************************************************************/
package org.eclipse.passage.loc.operator.seal;

Expand All @@ -25,7 +25,7 @@
import org.eclipse.passage.lic.equinox.LicensedApplication;
import org.eclipse.passage.lic.equinox.io.FileFromBundle;
import org.eclipse.passage.lic.execute.FocusedAccessCycleConfiguration;
import org.eclipse.passage.lic.internal.base.logging.Logging;
import org.eclipse.passage.lic.internal.execute.Logging;
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;

Expand Down

0 comments on commit 70266f3

Please sign in to comment.