-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Osgi updates for Grouper 5 #211
base: GROUPER_5_BRANCH
Are you sure you want to change the base?
Changes from 2 commits
3c45fea
53f1814
97ee252
19b0c5b
c897a52
0e30bae
b4abd5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
grouper.osgi.enable = true | ||
|
||
# directory of plugins, default to /opt/grouper/grouperWebapp/WEB-INF/grouperPlugins | ||
# {valueType: "string", required: true, order: 1000} | ||
grouper.osgi.jar.dir = /Users/jj/Documents/workspace/community/grouper-ext-auth/target | ||
|
||
# directory of felix cache of plugins, default to /opt/grouper/grouperWebapp/WEB-INF/grouperFelixCache | ||
# {valueType: "string", required: true, order: 2000} | ||
grouper.felix.cache.rootdir = /tmp/grouperFelixCache | ||
|
||
grouper.osgi.plugin.extauth.jar=grouper-authentication-plugin-0.0.1-SNAPSHOT.jar | ||
|
||
# grouper.osgi.framework.system.packages.extra=javax.*,org.osgi.*,org.osgi,org.apache.commons.logging,edu.internet2.middleware.grouperClient.config,edu.internet2.middleware.grouper.app.externalSystem,org.w3c.dom.* | ||
# grouper.osgi.framework.boot.delegation=javax.*,org.osgi.*,org.osgi,org.apache.commons.logging,edu.internet2.middleware.grouperClient.config,edu.internet2.middleware.grouper.app.externalSystem,org.w3c.dom.* |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ | |
<module>../grouper-ui</module> | ||
<module>../grouper-ws</module> | ||
<module>../grouper-misc/grouper-installer</module> | ||
<module>../grouper-misc/webapp/grouper-ui-webapp</module> | ||
<module>../grouper-misc/webapp</module> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recommend removing this. This is the list of modules that are built and published at every release, and for which documentation is built. You can always build this manually, even if it's not in this list. |
||
</modules> | ||
|
||
<properties> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
package edu.internet2.middleware.grouper.plugins; | ||
|
||
import edu.internet2.middleware.grouper.app.externalSystem.GrouperExternalSystem; | ||
import edu.internet2.middleware.grouper.cfg.GrouperConfig; | ||
import edu.internet2.middleware.grouper.cfg.GrouperHibernateConfig; | ||
import edu.internet2.middleware.grouper.util.GrouperUtil; | ||
import edu.internet2.middleware.grouperClient.config.ConfigPropertiesCascadeBase; | ||
import org.apache.commons.logging.Log; | ||
import org.apache.commons.logging.LogFactory; | ||
import org.osgi.framework.BundleContext; | ||
import org.osgi.framework.BundleException; | ||
|
@@ -16,6 +17,7 @@ | |
import java.lang.reflect.InvocationTargetException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.util.Arrays; | ||
import java.util.Dictionary; | ||
import java.util.HashMap; | ||
import java.util.HashSet; | ||
|
@@ -30,6 +32,8 @@ | |
* @author jj | ||
*/ | ||
public class FrameworkStarter { | ||
private final static Log LOG = GrouperUtil.getLog(FrameworkStarter.class); | ||
|
||
private final static FrameworkStarter frameworkStarter = new FrameworkStarter(); | ||
|
||
private Framework framework; | ||
|
@@ -51,8 +55,15 @@ public void start() { | |
// if it caches modules, they might not ever get reloaded | ||
configMap.put(Constants.FRAMEWORK_STORAGE_CLEAN, Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT); | ||
|
||
//TODO: maybe make this more dynamic. currently we're very opinionated on what we export | ||
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, GrouperConfig.retrieveConfig().propertyValueString("grouper.osgi.framework.system.packages.extra","javax.servlet,javax.servlet.http")); | ||
Set<String> frameworkSystemPackagesExtra = new HashSet<>(); | ||
// TODO: add any needed system packages here | ||
if (null != GrouperConfig.retrieveConfig().propertyValueString("grouper.osgi.framework.system.packages.extra")) { | ||
LOG.warn("You are setting a value for `grouper.osgi.framework.system.packages.extra`. This generally not needed and should not be used unless there is a good reason to do so"); | ||
scalding marked this conversation as resolved.
Show resolved
Hide resolved
|
||
frameworkSystemPackagesExtra.addAll(Arrays.asList(GrouperConfig.retrieveConfig().propertyValueString("grouper.osgi.framework.system.packages.extra", "").split(","))); | ||
} | ||
if (!frameworkSystemPackagesExtra.isEmpty()) { | ||
configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, String.join(",", frameworkSystemPackagesExtra)); | ||
} | ||
|
||
try { | ||
// set up cachedir | ||
|
@@ -65,18 +76,18 @@ public void start() { | |
|
||
// usually, this is a bad idea, but we have several classes that must be loaded from the framework classpath to work, | ||
// e.g., logging, configuration | ||
String packagesForBootDelegationString; | ||
Set<String> packagesForBootDelegation = new HashSet<>(); | ||
if (null != GrouperConfig.retrieveConfig().propertyValueString("grouper.osgi.framework.boot.delegation")) { | ||
packagesForBootDelegationString = GrouperConfig.retrieveConfig().propertyValueString("grouper.osgi.framework.boot.delegation"); | ||
LOG.warn("You are setting a value for `grouper.osgi.framework.boot.delegation`. This is generally not needed adn should not be used unless there is a good reason to do so"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo |
||
packagesForBootDelegation.addAll(Arrays.asList(GrouperConfig.retrieveConfig().propertyValueString("grouper.osgi.framework.boot.delegation").split(","))); | ||
} else { | ||
Set<String> packagesForBootDelegation = new HashSet<>(); | ||
packagesForBootDelegation.add(LogFactory.class.getPackage().getName()); | ||
packagesForBootDelegation.add(ConfigPropertiesCascadeBase.class.getPackage().getName()); | ||
// TODO: why oh why... need to fix this | ||
packagesForBootDelegation.add(GrouperExternalSystem.class.getPackage().getName()); | ||
packagesForBootDelegationString = String.join(",", packagesForBootDelegation); | ||
packagesForBootDelegation.add("org.osgi.*"); | ||
packagesForBootDelegation.add("javax.*"); | ||
packagesForBootDelegation.add("org.apache.commons.logging"); | ||
packagesForBootDelegation.add("edu.internet2.middleware.grouper.*"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need to check this, but could cause a problem if a plugin ends up in the classpath (e.g. class clash) |
||
packagesForBootDelegation.add("edu.internet2.middleware.grouperClient.*"); | ||
} | ||
configMap.put(Constants.FRAMEWORK_BOOTDELEGATION, packagesForBootDelegationString); | ||
configMap.put(Constants.FRAMEWORK_BOOTDELEGATION, String.join(",", packagesForBootDelegation)); | ||
|
||
try { | ||
FrameworkFactory frameworkFactory = ServiceLoader.load(FrameworkFactory.class).iterator().next(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take this out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I remember why this is here, but need to verify: ddls for some reason were missing from the classpath
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DDLs should be packaged in the grouper jar now