From 17ab4abc34cd258435a9efdb8dd00228af859613 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Sat, 31 Jul 2010 19:03:19 +0000 Subject: [PATCH] Introduce Eclipse support git-svn-id: https://svn.argeo.org/commons/trunk@3737 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- eclipse/plugins/org.argeo.eclipse.ui/pom.xml | 31 +++++ eclipse/plugins/pom.xml | 59 +++++++++ eclipse/pom.xml | 17 +++ pom.xml | 6 +- .../SecuredActiveMqConnectionFactory.java | 122 +++++++++--------- 5 files changed, 173 insertions(+), 62 deletions(-) create mode 100644 eclipse/plugins/org.argeo.eclipse.ui/pom.xml create mode 100644 eclipse/plugins/pom.xml create mode 100644 eclipse/pom.xml diff --git a/eclipse/plugins/org.argeo.eclipse.ui/pom.xml b/eclipse/plugins/org.argeo.eclipse.ui/pom.xml new file mode 100644 index 000000000..b03db8139 --- /dev/null +++ b/eclipse/plugins/org.argeo.eclipse.ui/pom.xml @@ -0,0 +1,31 @@ + + 4.0.0 + + org.argeo.commons.eclipse + 0.2.1-SNAPSHOT + plugins + .. + + org.argeo.eclipse.ui + Commons Eclipse UI + jar + + + org.eclipse.ui + org.eclipse.ui + + + org.eclipse.core + org.eclipse.core.runtime + + + com.ibm.icu + com.ibm.icu + + + org.springframework + org.springframework.context + + + diff --git a/eclipse/plugins/pom.xml b/eclipse/plugins/pom.xml new file mode 100644 index 000000000..eae64b56a --- /dev/null +++ b/eclipse/plugins/pom.xml @@ -0,0 +1,59 @@ + + 4.0.0 + + org.argeo.commons + 0.2.1-SNAPSHOT + eclipse + .. + + org.argeo.commons.eclipse + plugins + Commons Eclipse plugins + pom + + org.argeo.eclipse.ui + + + + + . + + plugin.xml + META-INF/** + + + + + + maven-jar-plugin + + + META-INF/MANIFEST.MF + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-source-plugin + + + attach-sources + package + + jar + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + + diff --git a/eclipse/pom.xml b/eclipse/pom.xml new file mode 100644 index 000000000..febfcd129 --- /dev/null +++ b/eclipse/pom.xml @@ -0,0 +1,17 @@ + + + 4.0.0 + + org.argeo.commons + 0.2.1-SNAPSHOT + argeo-commons + .. + + eclipse + Commons Eclipse + pom + + plugins + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 1f4dcc3dd..e538b0602 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 org.argeo @@ -15,7 +16,7 @@ 0.2 1.1.0-SNAPSHOT 0.12.4 - 0.1.28 + 0.1.29-SNAPSHOT 2.0.1 1.1.0-SNAPSHOT file:///var/argeo/projects/commons/www/site @@ -71,6 +72,7 @@ limitations under the License. osgi server security + eclipse sandbox diff --git a/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/activemq/SecuredActiveMqConnectionFactory.java b/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/activemq/SecuredActiveMqConnectionFactory.java index 26a05b3d6..95e6a6945 100644 --- a/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/activemq/SecuredActiveMqConnectionFactory.java +++ b/security/runtime/org.argeo.security.core/src/main/java/org/argeo/security/activemq/SecuredActiveMqConnectionFactory.java @@ -46,7 +46,8 @@ public class SecuredActiveMqConnectionFactory implements ConnectionFactory, public final static String AUTHMODE_UI = "ui"; public final static String AUTHMODE_OS = "os"; public final static String AUTHMODE_DEFAULT = AUTHMODE_OS; -// private final static String LOGIN_CONFIG_PROPERTY = "java.security.auth.login.config"; + // private final static String LOGIN_CONFIG_PROPERTY = + // "java.security.auth.login.config"; private final static Log log = LogFactory .getLog(SecuredActiveMqConnectionFactory.class); @@ -77,6 +78,7 @@ public class SecuredActiveMqConnectionFactory implements ConnectionFactory, uccfa.setTargetConnectionFactory(activeMQSslConnectionFactory); cachingConnectionFactory = new CachingConnectionFactory(); cachingConnectionFactory.setTargetConnectionFactory(uccfa); + cachingConnectionFactory.setCacheConsumers(false); initConnectionFactoryCredentials(uccfa); cachingConnectionFactory.initConnection(); @@ -92,64 +94,64 @@ public class SecuredActiveMqConnectionFactory implements ConnectionFactory, authenticationMode = AUTHMODE_DEFAULT; if (AUTHMODE_OS.equals(authenticationMode)) { -// if (false) { -// // Cache previous value of login conf location -// String oldLoginConfLocation = System -// .getProperty(LOGIN_CONFIG_PROPERTY); -// // Find OS family -// String osName = System.getProperty("os.name"); -// final String auth; -// if (osName.startsWith("Windows")) -// auth = "Windows"; -// else if (osName.startsWith("SunOS") -// || osName.startsWith("Solaris")) -// auth = "Solaris"; -// else -// auth = "Unix"; -// -// Subject subject; -// // see http://old.nabble.com/osgi-and-jaas-td23485885.html -// ClassLoader ccl = Thread.currentThread() -// .getContextClassLoader(); -// try { -// Thread.currentThread().setContextClassLoader( -// getClass().getClassLoader()); -// URL url = getClass().getResource( -// "/org/argeo/security/activemq/osLogin.conf"); -// -// System.setProperty(LOGIN_CONFIG_PROPERTY, url.toString()); -// LoginContext lc = new LoginContext(auth); -// lc.login(); -// subject = lc.getSubject(); -// } catch (LoginException le) { -// throw new ArgeoException("OS authentication failed", le); -// } finally { -// if (oldLoginConfLocation != null) -// System.setProperty(LOGIN_CONFIG_PROPERTY, -// oldLoginConfLocation); -// Thread.currentThread().setContextClassLoader(ccl); -// } -// // Extract user name -// String osUsername = null; -// for (Principal principal : subject.getPrincipals()) { -// String className = principal.getClass().getName(); -// if ("Unix".equals(auth) -// && "com.sun.security.auth.UnixPrincipal" -// .equals(className)) -// osUsername = principal.getName(); -// else if ("Windows".equals(auth) -// && "com.sun.security.auth.NTUserPrincipal" -// .equals(className)) -// osUsername = principal.getName(); -// else if ("Solaris".equals(auth) -// && "com.sun.security.auth.SolarisPrincipal" -// .equals(className)) -// osUsername = principal.getName(); -// } -// -// if (osUsername == null) -// throw new ArgeoException("Could not find OS user name"); -// } + // if (false) { + // // Cache previous value of login conf location + // String oldLoginConfLocation = System + // .getProperty(LOGIN_CONFIG_PROPERTY); + // // Find OS family + // String osName = System.getProperty("os.name"); + // final String auth; + // if (osName.startsWith("Windows")) + // auth = "Windows"; + // else if (osName.startsWith("SunOS") + // || osName.startsWith("Solaris")) + // auth = "Solaris"; + // else + // auth = "Unix"; + // + // Subject subject; + // // see http://old.nabble.com/osgi-and-jaas-td23485885.html + // ClassLoader ccl = Thread.currentThread() + // .getContextClassLoader(); + // try { + // Thread.currentThread().setContextClassLoader( + // getClass().getClassLoader()); + // URL url = getClass().getResource( + // "/org/argeo/security/activemq/osLogin.conf"); + // + // System.setProperty(LOGIN_CONFIG_PROPERTY, url.toString()); + // LoginContext lc = new LoginContext(auth); + // lc.login(); + // subject = lc.getSubject(); + // } catch (LoginException le) { + // throw new ArgeoException("OS authentication failed", le); + // } finally { + // if (oldLoginConfLocation != null) + // System.setProperty(LOGIN_CONFIG_PROPERTY, + // oldLoginConfLocation); + // Thread.currentThread().setContextClassLoader(ccl); + // } + // // Extract user name + // String osUsername = null; + // for (Principal principal : subject.getPrincipals()) { + // String className = principal.getClass().getName(); + // if ("Unix".equals(auth) + // && "com.sun.security.auth.UnixPrincipal" + // .equals(className)) + // osUsername = principal.getName(); + // else if ("Windows".equals(auth) + // && "com.sun.security.auth.NTUserPrincipal" + // .equals(className)) + // osUsername = principal.getName(); + // else if ("Solaris".equals(auth) + // && "com.sun.security.auth.SolarisPrincipal" + // .equals(className)) + // osUsername = principal.getName(); + // } + // + // if (osUsername == null) + // throw new ArgeoException("Could not find OS user name"); + // } uccfa.setUsername(System.getProperty("user.name")); uccfa.setPassword(null); @@ -201,7 +203,7 @@ public class SecuredActiveMqConnectionFactory implements ConnectionFactory, new SecureRandom()); } catch (Exception e) { throw new ArgeoException( - "Cannot initailize JMS conneciton factory", e); + "Cannot initialize JMS connection factory", e); } } -- 2.30.2