Package structure refactored

This commit is contained in:
Konstantin Krivopustov 2008-12-04 05:58:59 +00:00
parent c9bb8617ab
commit 9ce6726464
23 changed files with 112 additions and 69 deletions

View File

@ -310,6 +310,64 @@
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
</component>
<component name="SvnBranchConfigurationManager">
<option name="myConfigurationMap">
<map>
<entry key="$PROJECT_DIR$">
<value>
<SvnBranchConfiguration>
<option name="branchMap">
<map>
<entry key="svn://dc/cuba/branches">
<value>
<list />
</value>
</entry>
<entry key="svn://dc/cuba/tags">
<value>
<list />
</value>
</entry>
</map>
</option>
<option name="branchUrls">
<list>
<option value="svn://dc/cuba/branches" />
<option value="svn://dc/cuba/tags" />
</list>
</option>
<option name="trunkUrl" value="svn://dc/cuba/trunk" />
</SvnBranchConfiguration>
</value>
</entry>
<entry key="$PROJECT_DIR$/modules/core">
<value>
<SvnBranchConfiguration>
<option name="branchMap">
<map>
<entry key="svn://dc/cuba/branches">
<value>
<list />
</value>
</entry>
<entry key="svn://dc/cuba/tags">
<value>
<list />
</value>
</entry>
</map>
</option>
<option name="branchUrls">
<list>
<option value="svn://dc/cuba/branches" />
<option value="svn://dc/cuba/tags" />
</list>
</option>
<option name="trunkUrl" value="svn://dc/cuba/trunk" />
</SvnBranchConfiguration>
</value>
</entry>
</map>
</option>
<option name="myVersion" value="124" />
</component>
<component name="VcsDirectoryMappings">

View File

@ -10,7 +10,7 @@
*/
package com.haulmont.cuba.client;
import com.haulmont.cuba.security.global.LoginService;
import com.haulmont.cuba.security.global.LoginServiceRemote;
import com.haulmont.cuba.security.global.JaasConfiguration;
import javax.naming.Context;
@ -51,7 +51,7 @@ public class Client
connProps.put("java.naming.provider.url", "localhost:1099");
Context ctx = new InitialContext(connProps);
LoginService ls = (LoginService) ctx.lookup("cuba/security/LoginService/remote");
LoginServiceRemote ls = (LoginServiceRemote) ctx.lookup("cuba/security/LoginService/remote");
try {
ls.authenticate(null, null, null);

View File

@ -17,7 +17,7 @@
<property name="openjpa.ConnectionFactoryProperties" value="PrettyPrint=true, PrettyPrintLineLength=72"/>
<property name="openjpa.jdbc.DBDictionary" value="hsql(SimulateLocking=true)"/>
<property name="openjpa.jdbc.MappingDefaults"
value="FieldStrategies='java.util.UUID=com.haulmont.cuba.core.persistence.UuidValueHandler'"/>
value="FieldStrategies='java.util.UUID=com.haulmont.cuba.core.impl.persistence.UuidValueHandler'"/>
</properties>
</persistence-unit>
</persistence>

View File

@ -1,39 +0,0 @@
/*
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
* Author: Konstantin Krivopustov
* Created: 13.11.2008 14:13:23
*
* $Id$
*/
package com.haulmont.cuba.core.ejb;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.security.SecurityAssociation;
import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;
import java.security.Principal;
public class ServiceInterceptor
{
@AroundInvoke
private Object aroundInvoke(InvocationContext ctx) throws Exception {
Log log = LogFactory.getLog(ctx.getTarget().getClass());
Principal principal = SecurityAssociation.getCallerPrincipal();
char[] credential = (char[]) SecurityAssociation.getCredential();
log.debug("Invoking method " + ctx.getMethod().getName() +
", user=" + principal.getName() + ", session=" + String.valueOf(credential));
try {
return ctx.proceed();
} catch (Exception e) {
log.error("ServiceInterceptor caught exception: ", e);
throw e;
}
}
}

View File

@ -14,7 +14,6 @@ import org.apache.commons.logging.LogFactory;
import org.apache.commons.lang.StringUtils;
import org.apache.openjpa.persistence.OpenJPAEntityManagerFactory;
import org.apache.openjpa.persistence.OpenJPAPersistence;
import org.apache.openjpa.persistence.EntityManagerFactoryImpl;
import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI;
import javax.naming.Context;
@ -29,7 +28,7 @@ import com.haulmont.cuba.core.PersistenceProvider;
import com.haulmont.cuba.core.EntityManagerFactoryAdapter;
import com.haulmont.cuba.core.EntityManagerAdapter;
import com.haulmont.cuba.core.CubaProperties;
import com.haulmont.cuba.core.persistence.EntityLifecycleListener;
import com.haulmont.cuba.core.impl.persistence.EntityLifecycleListener;
public class ManagedPersistenceProvider extends PersistenceProvider
{

View File

@ -12,7 +12,7 @@ package com.haulmont.cuba.core.impl;
import com.haulmont.cuba.core.global.SecurityProvider;
import com.haulmont.cuba.security.global.UserSession;
import com.haulmont.cuba.security.session.UserSessionManager;
import com.haulmont.cuba.security.impl.UserSessionManager;
import java.util.UUID;

View File

@ -8,7 +8,7 @@
*
* $Id$
*/
package com.haulmont.cuba.core.persistence;
package com.haulmont.cuba.core.impl.persistence;
import com.haulmont.cuba.core.global.SecurityProvider;
import com.haulmont.cuba.core.global.TimeProvider;

View File

@ -7,7 +7,7 @@
* Created: 07.11.2008 19:09:04
* $Id$
*/
package com.haulmont.cuba.core.persistence;
package com.haulmont.cuba.core.impl.persistence;
import org.apache.openjpa.jdbc.meta.strats.AbstractValueHandler;
import org.apache.openjpa.jdbc.meta.ValueMapping;

View File

@ -8,7 +8,9 @@
*
* $Id$
*/
package com.haulmont.cuba.core.global;
package com.haulmont.cuba.core.service;
import com.haulmont.cuba.core.global.BasicServiceRemote;
import javax.ejb.Local;

View File

@ -8,13 +8,15 @@
*
* $Id$
*/
package com.haulmont.cuba.core.ejb;
package com.haulmont.cuba.core.service;
import com.haulmont.cuba.core.entity.BaseEntity;
import com.haulmont.cuba.core.global.BasicInvocationContext;
import com.haulmont.cuba.core.global.BasicService;
import com.haulmont.cuba.core.service.BasicService;
import com.haulmont.cuba.core.global.BasicServiceRemote;
import com.haulmont.cuba.core.Locator;
import com.haulmont.cuba.core.worker.BasicWorker;
import com.haulmont.cuba.core.impl.ServiceInterceptor;
import javax.ejb.Stateless;
import javax.interceptor.Interceptors;

View File

@ -8,7 +8,7 @@
*
* $Id$
*/
package com.haulmont.cuba.core.ejb;
package com.haulmont.cuba.core.worker;
import com.haulmont.cuba.core.entity.BaseEntity;
import com.haulmont.cuba.core.global.BasicInvocationContext;

View File

@ -8,7 +8,7 @@
*
* $Id$
*/
package com.haulmont.cuba.core.ejb;
package com.haulmont.cuba.core.worker;
import com.haulmont.cuba.core.entity.BaseEntity;
import com.haulmont.cuba.core.global.BasicInvocationContext;

View File

@ -17,7 +17,7 @@ import java.util.List;
import java.util.Locale;
@Remote
public interface LoginService
public interface LoginServiceRemote
{
String JNDI_NAME = "cuba/security/LoginService";

View File

@ -8,7 +8,7 @@
*
* $Id$
*/
package com.haulmont.cuba.security.session;
package com.haulmont.cuba.security.impl;
import com.haulmont.cuba.security.entity.User;
import com.haulmont.cuba.security.entity.Profile;

View File

@ -8,7 +8,7 @@
*
* $Id$
*/
package com.haulmont.cuba.security.session;
package com.haulmont.cuba.security.impl;
import com.haulmont.cuba.security.global.UserSession;

View File

@ -8,7 +8,7 @@
*
* $Id$
*/
package com.haulmont.cuba.security.session;
package com.haulmont.cuba.security.impl;
import com.haulmont.cuba.security.global.UserSession;

View File

@ -0,0 +1,20 @@
/*
* Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved.
* Haulmont Technology proprietary and confidential.
* Use is subject to license terms.
* Author: Konstantin Krivopustov
* Created: 04.12.2008 9:40:11
*
* $Id$
*/
package com.haulmont.cuba.security.service;
import com.haulmont.cuba.security.global.LoginServiceRemote;
import javax.ejb.Local;
@Local
public interface LoginService extends LoginServiceRemote
{
}

View File

@ -8,13 +8,14 @@
*
* $Id$
*/
package com.haulmont.cuba.security.ejb;
package com.haulmont.cuba.security.service;
import com.haulmont.cuba.core.Locator;
import com.haulmont.cuba.security.entity.Profile;
import com.haulmont.cuba.security.global.LoginService;
import com.haulmont.cuba.security.global.LoginServiceRemote;
import com.haulmont.cuba.security.global.UserSession;
import com.haulmont.cuba.security.global.LoginException;
import com.haulmont.cuba.security.worker.LoginWorker;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -22,8 +23,8 @@ import javax.ejb.Stateless;
import java.util.List;
import java.util.Locale;
@Stateless(name = LoginService.JNDI_NAME)
public class LoginServiceBean implements LoginService
@Stateless(name = LoginServiceRemote.JNDI_NAME)
public class LoginServiceBean implements LoginService, LoginServiceRemote
{
private Log log = LogFactory.getLog(LoginServiceBean.class);

View File

@ -8,14 +8,14 @@
*
* $Id$
*/
package com.haulmont.cuba.security.ejb;
package com.haulmont.cuba.security.worker;
import com.haulmont.cuba.security.global.LoginService;
import com.haulmont.cuba.security.global.LoginServiceRemote;
import javax.ejb.Local;
@Local
public interface LoginWorker extends LoginService
public interface LoginWorker extends LoginServiceRemote
{
String JNDI_NAME = "cuba/security/LoginWorker";
}

View File

@ -8,7 +8,7 @@
*
* $Id$
*/
package com.haulmont.cuba.security.ejb;
package com.haulmont.cuba.security.worker;
import com.haulmont.cuba.security.global.UserSession;
import com.haulmont.cuba.security.global.LoginException;
@ -16,7 +16,7 @@ import com.haulmont.cuba.security.global.NoUserSessionException;
import com.haulmont.cuba.security.entity.Profile;
import com.haulmont.cuba.security.entity.User;
import com.haulmont.cuba.security.resources.Messages;
import com.haulmont.cuba.security.session.UserSessionManager;
import com.haulmont.cuba.security.impl.UserSessionManager;
import com.haulmont.cuba.core.PersistenceProvider;
import com.haulmont.cuba.core.EntityManagerAdapter;
import com.haulmont.cuba.core.QueryAdapter;

View File

@ -10,7 +10,7 @@
*/
package com.haulmont.cuba.core;
import com.haulmont.cuba.core.global.BasicService;
import com.haulmont.cuba.core.service.BasicService;
import com.haulmont.cuba.core.global.BasicInvocationContext;
import com.haulmont.cuba.core.global.BasicServiceRemote;
import com.haulmont.cuba.core.entity.Server;

View File

@ -16,7 +16,7 @@ public class CubaTestCase extends TestCase
{
protected void setUpDeploymentFiles() {
TestContainer.addDeploymentFile("cuba-core-global.jar");
TestContainer.addDeploymentFile("20-cuba-core.jar");
TestContainer.addDeploymentFile("20cuba-core.jar");
}
protected void setUp() throws Exception {

View File

@ -12,11 +12,11 @@ package com.haulmont.cuba.security;
import com.haulmont.cuba.core.CubaTestCase;
import com.haulmont.cuba.core.Locator;
import com.haulmont.cuba.core.service.BasicService;
import com.haulmont.cuba.core.entity.Server;
import com.haulmont.cuba.core.global.BasicService;
import com.haulmont.cuba.core.global.BasicInvocationContext;
import com.haulmont.cuba.core.global.SecurityProvider;
import com.haulmont.cuba.security.ejb.LoginWorker;
import com.haulmont.cuba.security.worker.LoginWorker;
import com.haulmont.cuba.security.entity.Profile;
import com.haulmont.cuba.security.entity.User;
import com.haulmont.cuba.security.global.JaasCallbackHandler;