Return-Path: X-Original-To: apmail-zest-commits-archive@minotaur.apache.org Delivered-To: apmail-zest-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E6B9618207 for ; Wed, 10 Jun 2015 04:21:38 +0000 (UTC) Received: (qmail 4213 invoked by uid 500); 10 Jun 2015 04:21:38 -0000 Delivered-To: apmail-zest-commits-archive@zest.apache.org Received: (qmail 4159 invoked by uid 500); 10 Jun 2015 04:21:38 -0000 Mailing-List: contact commits-help@zest.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zest.apache.org Delivered-To: mailing list commits@zest.apache.org Received: (qmail 4123 invoked by uid 99); 10 Jun 2015 04:21:38 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Jun 2015 04:21:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 92CEEE0009; Wed, 10 Jun 2015 04:21:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: niclas@apache.org To: commits@zest.apache.org Date: Wed, 10 Jun 2015 04:21:41 -0000 Message-Id: <17ab7c3ea167469d9224111ad5788044@git.apache.org> In-Reply-To: <532db60551d54f8693751ce9f50295f6@git.apache.org> References: <532db60551d54f8693751ce9f50295f6@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [4/6] zest-qi4j git commit: * Removed Google AppEngine EntityStore and associated test. * Removed Neo4j, both Entity Store and Library, due to lacking response from Neo Technologis regarding the GPLv3 'pollution'. * Removed Google AppEngine EntityStore and associated test. * Removed Neo4j, both Entity Store and Library, due to lacking response from Neo Technologis regarding the GPLv3 'pollution'. Project: http://git-wip-us.apache.org/repos/asf/zest-qi4j/repo Commit: http://git-wip-us.apache.org/repos/asf/zest-qi4j/commit/70f25289 Tree: http://git-wip-us.apache.org/repos/asf/zest-qi4j/tree/70f25289 Diff: http://git-wip-us.apache.org/repos/asf/zest-qi4j/diff/70f25289 Branch: refs/heads/develop Commit: 70f2528983a278e2e272b8b7bbea0447f23cbc1e Parents: 484e311 Author: Niclas Hedhman Authored: Wed Jun 10 11:44:20 2015 +0800 Committer: Niclas Hedhman Committed: Wed Jun 10 11:44:20 2015 +0800 ---------------------------------------------------------------------- .../java/org/qi4j/api/common/UseDefaults.java | 2 +- .../org/qi4j/api/metrics/MetricsProvider.java | 23 + extensions/entitystore-gae/NOTICE | 16 - extensions/entitystore-gae/build.gradle | 18 - extensions/entitystore-gae/dev-status.xml | 19 - extensions/entitystore-gae/src/docs/es-gae.txt | 13 - .../qi4j/entitystore/gae/GaeEntityState.java | 427 ------------- .../gae/GaeEntityStoreActivation.java | 40 -- .../entitystore/gae/GaeEntityStoreMixin.java | 103 --- .../entitystore/gae/GaeEntityStoreService.java | 40 -- .../gae/GaeEntityStoreUnitOfWork.java | 147 ----- .../entitystore/gae/GaeIdGeneratorService.java | 62 -- .../gae2/GaeEntityStoreActivation.java | 43 -- .../gae2/GaeEntityStoreConfiguration.java | 32 - .../entitystore/gae2/GaeEntityStoreMixin.java | 221 ------- .../entitystore/gae2/GaeEntityStoreService.java | 48 -- .../GaeEntityStoreService.properties | 5 - .../java/org/qi4j/entitystore/gae/readme.html | 12 - extensions/entitystore-neo4j/NOTICE.txt | 27 - extensions/entitystore-neo4j/build.gradle | 17 - extensions/entitystore-neo4j/dev-status.xml | 20 - .../entitystore-neo4j/license-explain.txt | 68 -- .../licenses/neo4j-commercial.license | 3 - .../licenses/neo4j-opensource.license | 619 ------------------- .../entitystore-neo4j/src/docs/es-neo4j.txt | 35 -- .../entitystore/neo4j/NeoConfiguration.java | 33 - .../qi4j/entitystore/neo4j/NeoEntityState.java | 293 --------- .../entitystore/neo4j/NeoEntityStoreMixin.java | 151 ----- .../neo4j/NeoEntityStoreService.java | 13 - .../neo4j/NeoEntityStoreUnitOfWork.java | 220 ------- .../neo4j/NeoManyAssociationState.java | 170 ----- .../neo4j/NeoNamedAssociationState.java | 152 ----- .../org/qi4j/entitystore/neo4j/RelTypes.java | 12 - .../org/qi4j/entitystore/neo4j/package.html | 5 - .../neo4j/test/SimpleNeoStoreTest.java | 40 -- .../qi4j/metrics/yammer/YammerMetricsMixin.java | 2 +- libraries/lang-beanshell/dev-status.xml | 2 +- .../inspection/event/InspectArrivedCargo.java | 2 +- .../inspection/event/InspectCargoInCustoms.java | 2 +- .../inspection/event/InspectClaimedCargo.java | 2 +- .../inspection/event/InspectReceivedCargo.java | 2 +- .../inspection/event/InspectUnhandledCargo.java | 2 +- .../inspection/event/InspectUnloadedCargo.java | 2 +- samples/forum/build.gradle | 2 +- .../samples/forum/assembler/ForumAssembler.java | 9 +- settings.gradle | 4 - tests/complex/gae/build.gradle | 18 - .../java/org/qi4j/test/gae/GaeTestServlet.java | 126 ---- .../main/java/org/qi4j/test/gae/UnitTests.java | 36 -- .../java/org/qi4j/test/gae2/GaeTestServlet.java | 126 ---- .../main/java/org/qi4j/test/gae2/UnitTests.java | 43 -- .../gae2/GaeEntityStoreService.properties | 5 - tests/complex/gae/web/WEB-INF/appengine-web.xml | 5 - tests/complex/gae/web/WEB-INF/web.xml | 28 - tests/complex/gae/web/index.jsp | 12 - 55 files changed, 37 insertions(+), 3542 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java b/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java index 8478d99..94f4446 100644 --- a/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java +++ b/core/api/src/main/java/org/qi4j/api/common/UseDefaults.java @@ -46,7 +46,7 @@ import java.lang.annotation.Target; *

*

* It is also possible to change the default values for Composites during the assembly. This is done by calling the - * {@link org.qi4j.bootstrap.ModuleAssembly#forMixin(Class)} method. + * {@code org.qi4j.bootstrap.ModuleAssembly#forMixin(Class)} method. *

*

* Example; http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/core/api/src/main/java/org/qi4j/api/metrics/MetricsProvider.java ---------------------------------------------------------------------- diff --git a/core/api/src/main/java/org/qi4j/api/metrics/MetricsProvider.java b/core/api/src/main/java/org/qi4j/api/metrics/MetricsProvider.java index 404b31d..d7cd063 100644 --- a/core/api/src/main/java/org/qi4j/api/metrics/MetricsProvider.java +++ b/core/api/src/main/java/org/qi4j/api/metrics/MetricsProvider.java @@ -18,16 +18,39 @@ package org.qi4j.api.metrics; /** * Metrics Provider SPI. + *

+ * The Qi4j Runtime will automatically ook for a service that implements the MetricsProvider interdace + * and use it for internal Runtime metrics, such as the UnitOfWork measuring the time from creation to close. + *

+ *

+ * The Metrics Library is available to add metric functionality to applications in the same way, and + * will use the same MetricsProvider. + *

+ *

+ * Note that the usual visibitlity rules applies, so you might have more than one MetricsProvider server, + * perhaps per layer. + *

*/ public interface MetricsProvider { /** * Creates a new factory instance. * + * The instanctiation is done by providing a Metric type, which is one of + *
    + *
  • {@link MetricsCounter}
  • + *
  • {@link MetricsGauge}
  • + *
  • {@link MetricsHealthCheck}
  • + *
  • {@link MetricsHistogram}
  • + *
  • {@link MetricsMeter}
  • + *
  • {@link MetricsTimer}
  • + *
+ * * @param factoryType The class of the metric type needed. * @param The metric type requested. * * @return A factory instance + * * @throws MetricsNotSupportedException when the MetricsProvider is not supporting the factory type requested. */ T createFactory( Class factoryType ) http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/NOTICE ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/NOTICE b/extensions/entitystore-gae/NOTICE deleted file mode 100644 index 1a8e31c..0000000 --- a/extensions/entitystore-gae/NOTICE +++ /dev/null @@ -1,16 +0,0 @@ -Qi4j Google AppEngine Persistence Extension -Copyright 2007-2008, The Qi4j Development Team of individuals. - -See http://www.qi4j.org/contributors.html for list of of individuals. -Also see each file for additional information of Copyright claims. - -Qi4j is a community aggregated works under Copyright law. -All parts of the original works at Qi4j is licensed under the -Apache License ver 2.0 http://www.apache.org/licenses - -Below follows a list of binary dependencies and their licenses; ----------------------------------------------------------------- - - - -END OF NOTICE \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/build.gradle ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/build.gradle b/extensions/entitystore-gae/build.gradle deleted file mode 100644 index 4225f5d..0000000 --- a/extensions/entitystore-gae/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ - -description = "Qi4j Google AppEngine Extension. Utilizes the GAE data store as EntityStore for applications deployed on GAE." - -jar { manifest { name = "Qi4j Extension - EntityStore - Google App Engine" }} - -dependencies { - - compile project(":org.qi4j.core:org.qi4j.core.spi" ) - compile project(":org.qi4j.core:org.qi4j.core.bootstrap" ) - compile project(":org.qi4j.libraries:org.qi4j.library.locking" ) - compile libraries.appengine - - testCompile project( ":org.qi4j.core:org.qi4j.core.testsupport" ) - - testRuntime project( ":org.qi4j.core:org.qi4j.core.runtime" ) - testRuntime libraries.logback - -} http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/dev-status.xml ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/dev-status.xml b/extensions/entitystore-gae/dev-status.xml deleted file mode 100644 index 5f2d3dc..0000000 --- a/extensions/entitystore-gae/dev-status.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - beta - - - none - - - none - - - ALv2 - - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/src/docs/es-gae.txt ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/src/docs/es-gae.txt b/extensions/entitystore-gae/src/docs/es-gae.txt deleted file mode 100644 index 5647853..0000000 --- a/extensions/entitystore-gae/src/docs/es-gae.txt +++ /dev/null @@ -1,13 +0,0 @@ -[[extension-es-gae,AppEngine EntityStore]] -= Google AppEngine EntityStore = - -[devstatus] --------------- -source=extensions/entitystore-gae/dev-status.xml --------------- - -AppEngine EntityStore - -NOTE: This Extension has no documentation yet. Learn how to contribute in <>. - -include::../../build/docs/buildinfo/artifact.txt[] http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java deleted file mode 100644 index a694c32..0000000 --- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityState.java +++ /dev/null @@ -1,427 +0,0 @@ -/* - * Copyright 2010 Niclas Hedhman. - * - * Licensed 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. - */ - -package org.qi4j.entitystore.gae; - -import com.google.appengine.api.datastore.Entity; -import com.google.appengine.api.datastore.Key; -import com.google.appengine.api.datastore.Text; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import org.qi4j.api.common.QualifiedName; -import org.qi4j.api.entity.EntityDescriptor; -import org.qi4j.api.entity.EntityReference; -import org.qi4j.api.property.PropertyDescriptor; -import org.qi4j.api.structure.Module; -import org.qi4j.api.type.ValueCompositeType; -import org.qi4j.api.type.ValueType; -import org.qi4j.api.value.ValueSerialization; -import org.qi4j.api.value.ValueSerializationException; -import org.qi4j.spi.entity.EntityState; -import org.qi4j.spi.entity.EntityStatus; -import org.qi4j.spi.entity.ManyAssociationState; -import org.qi4j.spi.entity.NamedAssociationState; - -import static org.qi4j.functional.Iterables.first; -import static org.qi4j.functional.Iterables.toList; - -public class GaeEntityState - implements EntityState -{ - static final String PROPERTY_TYPE = "$type"; - - private final Entity entity; - private EntityStatus status; - private final GaeEntityStoreUnitOfWork unitOfWork; - private final ValueSerialization valueSerialization; - private final EntityDescriptor descriptor; - private final HashMap valueTypes; - private final Module module; - - public GaeEntityState( GaeEntityStoreUnitOfWork unitOfWork, - ValueSerialization valueSerialization, - Key key, - EntityDescriptor descriptor, - Module module ) - { - this.module = module; - this.unitOfWork = unitOfWork; - this.valueSerialization = valueSerialization; - this.descriptor = descriptor; - entity = new Entity( key ); - entity.setProperty( "$version", unitOfWork.identity() ); - Class type = first( descriptor.types() ); - String name = type.getName(); - entity.setUnindexedProperty( PROPERTY_TYPE, name ); - status = EntityStatus.NEW; - valueTypes = initializeValueTypes( descriptor ); - } - - public GaeEntityState( GaeEntityStoreUnitOfWork unitOfWork, - ValueSerialization valueSerialization, - Entity entity, - Module module ) - { - if( entity == null ) - { - throw new NullPointerException(); - } - if( unitOfWork == null ) - { - throw new NullPointerException(); - } - this.module = module; - this.unitOfWork = unitOfWork; - this.valueSerialization = valueSerialization; - this.entity = entity; - String typeName = (String) entity.getProperty( GaeEntityState.PROPERTY_TYPE ); - descriptor = module.entityDescriptor( typeName ); - status = EntityStatus.LOADED; - valueTypes = initializeValueTypes( descriptor ); - } - - private HashMap initializeValueTypes( EntityDescriptor descriptor ) - { - HashMap result = new HashMap(); - for( PropertyDescriptor persistent : descriptor.state().properties() ) - { - if( persistent.valueType() instanceof ValueCompositeType ) - { - QualifiedName name = persistent.qualifiedName(); - result.put( name, persistent.valueType() ); - } - } - return result; - } - - Entity entity() - { - return entity; - } - - @Override - public EntityReference identity() - { - EntityReference ref = new EntityReference( entity.getKey().getName() ); - return ref; - } - - @Override - public String version() - { - String version = (String) entity.getProperty( "$version" ); - return version; - } - - @Override - public long lastModified() - { - Long lastModified = (Long) entity.getProperty( "$lastModified" ); - return lastModified; - } - - @Override - public void remove() - { - status = EntityStatus.REMOVED; - } - - @Override - public EntityStatus status() - { - return status; - } - - @Override - public boolean isAssignableTo( Class type ) - { - return false; - } - - @Override - public EntityDescriptor entityDescriptor() - { - return descriptor; - } - - @Override - public Object propertyValueOf( QualifiedName stateName ) - { - String uri = stateName.toURI(); - Object value = entity.getProperty( uri ); - if( value instanceof Text ) - { - value = ( (Text) value ).getValue(); - } - ValueType type = valueTypes.get( stateName ); - if( value != null && type != null ) - { - try - { - value = valueSerialization.deserialize( type, value.toString() ); - } - catch( ValueSerializationException e ) - { - String message = "\nqualifiedName: " + stateName + - "\n stateName: " + stateName.name() + - "\n uri: " + uri + - "\n type: " + type + - "\n value: " + value + - "\n"; - InternalError error = new InternalError( message ); - error.initCause( e ); - throw error; - } - } - return value; - } - - @Override - public void setPropertyValue( QualifiedName stateName, Object newValue ) - { - Object value = null; - if( newValue == null || ValueType.isPrimitiveValue( newValue ) ) - { - value = newValue; - } - else - { - try - { - value = valueSerialization.serialize( newValue ); - } - catch( ValueSerializationException e ) - { - String message = "\nqualifiedName: " + stateName + - "\n stateName: " + stateName.name() + - "\n class: " + newValue.getClass() + - "\n value: " + value + - "\n"; - InternalError error = new InternalError( message ); - error.initCause( e ); - throw error; - } - } - if( value instanceof String ) - { - value = new Text( (String) value ); - } - entity.setUnindexedProperty( stateName.toURI(), value ); - } - - @Override - public EntityReference associationValueOf( QualifiedName stateName ) - { - String uri = stateName.toURI(); - String identity = (String) entity.getProperty( uri ); - EntityReference ref = new EntityReference( identity ); - return ref; - } - - @Override - public void setAssociationValue( QualifiedName stateName, EntityReference newEntity ) - { - String uri = stateName.toURI(); - String id = null; - if( newEntity != null ) - { - id = newEntity.identity(); - } - entity.setUnindexedProperty( uri, id ); - } - - @Override - public ManyAssociationState manyAssociationValueOf( QualifiedName stateName ) - { - List assocs = (List) entity.getProperty( stateName.toURI() ); - ManyAssociationState state = new GaeManyAssociationState( this, assocs ); - return state; - } - - @Override - public NamedAssociationState namedAssociationValueOf( QualifiedName stateName ) - { - Map assocs = (Map) entity.getProperty( stateName.toURI() ); - NamedAssociationState state = new GaeNamedAssociationState( this, assocs ); - return state; - } - - public void hasBeenApplied() - { - status = EntityStatus.LOADED; - } - - private static class GaeManyAssociationState - implements ManyAssociationState - { - private List assocs; - private final GaeEntityState entityState; - - public GaeManyAssociationState( GaeEntityState entityState, List listOfAssociations ) - { - this.entityState = entityState; - if( listOfAssociations == null ) - { - this.assocs = new ArrayList(); - } - else - { - this.assocs = listOfAssociations; - } - } - - @Override - public int count() - { - return assocs.size(); - } - - @Override - public boolean contains( EntityReference entityReference ) - { - return assocs.contains( entityReference.identity() ); - } - - @Override - public boolean add( int index, EntityReference entityReference ) - { - String identity = entityReference.identity(); - if( assocs.contains( identity ) ) - { - return false; - } - assocs.add( index, entityReference.identity() ); - entityState.markUpdated(); - return true; - } - - @Override - public boolean remove( EntityReference entityReference ) - { - return assocs.remove( entityReference.identity() ); - } - - @Override - public EntityReference get( int index ) - { - String id = assocs.get( index ); - return new EntityReference( id ); - } - - @Override - public Iterator iterator() - { - ArrayList result = new ArrayList(); - for( String id : assocs ) - { - result.add( new EntityReference( id ) ); - } - return result.iterator(); - } - } - - private static class GaeNamedAssociationState - implements NamedAssociationState - { - private final Map assocs; - private final GaeEntityState entityState; - - private GaeNamedAssociationState( GaeEntityState entityState, Map associations ) - { - this.entityState = entityState; - if( associations == null ) - { - this.assocs = new HashMap<>(); - } - else - { - this.assocs = associations; - } - } - - @Override - public int count() - { - return assocs.size(); - } - - @Override - public boolean containsName( String name ) - { - return assocs.containsKey( name ); - } - - @Override - public boolean put( String name, EntityReference entityReference ) - { - if( assocs.containsKey( name ) && entityReference.identity().equals( assocs.get( name ) ) ) - { - return false; - } - assocs.put( name, entityReference.identity() ); - entityState.markUpdated(); - return true; - } - - @Override - public boolean remove( String name ) - { - boolean removed = assocs.remove( name ) != null; - entityState.markUpdated(); - return removed; - } - - @Override - public EntityReference get( String name ) - { - return new EntityReference( assocs.get( name ) ); - } - - @Override - public String nameOf( EntityReference entityReference ) - { - String identity = entityReference.identity(); - for( Map.Entry entry : assocs.entrySet() ) - { - if( identity.equals( entry.getValue() ) ) - { - return entry.getKey(); - } - } - return null; - } - - @Override - public Iterator iterator() - { - return toList( assocs.keySet() ).iterator(); - } - - } - - private void markUpdated() - { - if( status == EntityStatus.LOADED ) - { - status = EntityStatus.UPDATED; - } - } -} http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreActivation.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreActivation.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreActivation.java deleted file mode 100644 index e0d1221..0000000 --- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreActivation.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2012, Paul Merlin. All Rights Reserved. - * - * Licensed 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. - * - */ -package org.qi4j.entitystore.gae; - -import org.qi4j.api.activation.ActivatorAdapter; -import org.qi4j.api.activation.Activators; -import org.qi4j.api.service.ServiceReference; - -@Activators( GaeEntityStoreActivation.Activator.class ) -public interface GaeEntityStoreActivation -{ - - void activateGaeEntityStore() - throws Exception; - - class Activator - extends ActivatorAdapter> - { - - @Override - public void afterActivation( ServiceReference activated ) - throws Exception - { - activated.get().activateGaeEntityStore(); - } - - } - -} http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java deleted file mode 100644 index 1986032..0000000 --- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreMixin.java +++ /dev/null @@ -1,103 +0,0 @@ -/* Copyright 2010 Niclas Hedhman - * - * Licensed 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. - */ -package org.qi4j.entitystore.gae; - -import com.google.appengine.api.datastore.*; -import org.qi4j.api.entity.Identity; -import org.qi4j.api.entity.IdentityGenerator; -import org.qi4j.api.injection.scope.Service; -import org.qi4j.api.service.qualifier.Tagged; -import org.qi4j.api.structure.Module; -import org.qi4j.api.usecase.Usecase; -import org.qi4j.api.value.ValueSerialization; -import org.qi4j.io.Input; -import org.qi4j.io.Output; -import org.qi4j.io.Receiver; -import org.qi4j.io.Sender; -import org.qi4j.spi.entity.EntityState; -import org.qi4j.spi.entitystore.EntityStore; -import org.qi4j.spi.entitystore.EntityStoreException; -import org.qi4j.spi.entitystore.EntityStoreUnitOfWork; - -/** - * GAE implementation of SerializationStore - */ -public class GaeEntityStoreMixin - implements GaeEntityStoreActivation, EntityStore -{ - private final ValueSerialization valueSerialization; - private final String uuid; - private long counter; - private DatastoreService datastoreService; - - public GaeEntityStoreMixin( @Service IdentityGenerator uuid, - @Service @Tagged( ValueSerialization.Formats.JSON ) ValueSerialization valueSerialization ) - { - this.uuid = uuid.generate(Identity.class) + ":"; - this.valueSerialization = valueSerialization; - counter = 0L; - } - - @Override - public void activateGaeEntityStore() - throws Exception - { - datastoreService = DatastoreServiceFactory.getDatastoreService(); - } - - @Override - public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime ) - { - return new GaeEntityStoreUnitOfWork( datastoreService, valueSerialization, generateId(), module, currentTime ); - } - - @Override - public Input entityStates(final Module module) - { - return new Input() - { - @Override - public void transferTo(Output output) throws EntityStoreException, ReceiverThrowableType - { - final GaeEntityStoreUnitOfWork euow = new GaeEntityStoreUnitOfWork( datastoreService, valueSerialization, - generateId(), module, - System.currentTimeMillis() ); - Query query = new Query(); - PreparedQuery q = datastoreService.prepare(query); - final QueryResultIterable iterable = q.asQueryResultIterable(); - - output.receiveFrom(new Sender() - { - @Override - public void sendTo(Receiver receiver) throws ReceiverThrowableType, EntityStoreException - { - for (Entity entity : iterable) - { - EntityState entityState = new GaeEntityState( euow, valueSerialization, entity, module ); - receiver.receive(entityState); - } - } - }); - } - }; - } - - private String generateId() - { - return uuid + counter++; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreService.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreService.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreService.java deleted file mode 100644 index c2db8df..0000000 --- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreService.java +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright 2010 Niclas Hedhman - * - * Licensed 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. - */ -package org.qi4j.entitystore.gae; - -import org.qi4j.api.concern.Concerns; -import org.qi4j.api.mixin.Mixins; -import org.qi4j.api.service.ServiceComposite; -import org.qi4j.library.locking.LockingAbstractComposite; -import org.qi4j.spi.entitystore.ConcurrentModificationCheckConcern; -import org.qi4j.spi.entitystore.EntityStateVersions; -import org.qi4j.spi.entitystore.EntityStore; -import org.qi4j.spi.entitystore.StateChangeNotificationConcern; - -/** - * EntityStore service backed by Google AppEngine's low-level store. - */ -@Concerns( { StateChangeNotificationConcern.class, ConcurrentModificationCheckConcern.class } ) -@Mixins( { GaeEntityStoreMixin.class } ) -public interface GaeEntityStoreService - extends GaeEntityStoreActivation, - EntityStore, - EntityStateVersions, - ServiceComposite, - LockingAbstractComposite -{ -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java deleted file mode 100644 index e32786d..0000000 --- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeEntityStoreUnitOfWork.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2010 Niclas Hedhman. - * - * Licensed 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. - */ - -package org.qi4j.entitystore.gae; - -import com.google.appengine.api.datastore.*; -import java.util.LinkedList; -import org.qi4j.api.entity.EntityDescriptor; -import org.qi4j.api.entity.EntityReference; -import org.qi4j.api.structure.Module; -import org.qi4j.api.value.ValueSerialization; -import org.qi4j.spi.entity.EntityState; -import org.qi4j.spi.entity.EntityStatus; -import org.qi4j.spi.entitystore.EntityNotFoundException; -import org.qi4j.spi.entitystore.EntityStoreException; -import org.qi4j.spi.entitystore.EntityStoreUnitOfWork; -import org.qi4j.spi.entitystore.StateCommitter; - -public class GaeEntityStoreUnitOfWork - implements EntityStoreUnitOfWork -{ - private final DatastoreService datastore; - private final ValueSerialization valueSerialization; - private final String identity; - private final Module module; - private final long currentTime; - private final LinkedList states; - - public GaeEntityStoreUnitOfWork( DatastoreService datastore, - ValueSerialization valueSerialization, - String identity, - Module module, - long currentTime ) - { - this.datastore = datastore; - this.valueSerialization = valueSerialization; - this.identity = identity; - this.module = module; - this.currentTime = currentTime; - states = new LinkedList(); - } - - @Override - public String identity() - { - return identity; - } - - @Override - public long currentTime() - { - return currentTime; - } - - @Override - public EntityState newEntityState( EntityReference anIdentity, EntityDescriptor entityDescriptor ) - throws EntityStoreException - { - Key key = KeyFactory.createKey( "qi4j-entity", anIdentity.identity() ); - GaeEntityState state = new GaeEntityState( this, valueSerialization, key, entityDescriptor, module ); - states.add( state ); - return state; - } - - @Override - public EntityState entityStateOf( EntityReference reference ) - throws EntityStoreException, EntityNotFoundException - { - Key key = KeyFactory.createKey( "qi4j-entity", reference.identity() ); - try - { - Entity entity = datastore.get( key ); - GaeEntityState state = new GaeEntityState( this, valueSerialization, entity, module ); - states.add( state ); - return state; - } - catch( com.google.appengine.api.datastore.EntityNotFoundException e ) - { - throw new EntityNotFoundException( reference ); - } - } - - @Override - public StateCommitter applyChanges() - throws EntityStoreException - { - Transaction transaction = datastore.beginTransaction(); - for( GaeEntityState state : states ) - { - Entity entity = state.entity(); - if( state.status() == EntityStatus.NEW || - state.status() == EntityStatus.UPDATED ) - { - datastore.put( transaction, entity ); - } - if( state.status() == EntityStatus.REMOVED ) - { - datastore.delete( transaction, entity.getKey() ); - } - } - return new GaeStateCommitter( transaction ); - } - - @Override - public void discard() - { - // nothing to do?? - } - - private static class GaeStateCommitter - implements StateCommitter - { - private Transaction transaction; - - public GaeStateCommitter( Transaction transaction ) - { - this.transaction = transaction; - } - - @Override - public void commit() - { - transaction.commit(); - } - - @Override - public void cancel() - { - transaction.rollback(); - } - } -} http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeIdGeneratorService.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeIdGeneratorService.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeIdGeneratorService.java deleted file mode 100644 index 8e37001..0000000 --- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae/GaeIdGeneratorService.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2010 Niclas Hedhman. - * - * Licensed 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. - */ - -package org.qi4j.entitystore.gae; - -import com.google.appengine.api.datastore.DatastoreService; -import com.google.appengine.api.datastore.DatastoreServiceFactory; -import com.google.appengine.api.datastore.Key; -import java.util.Iterator; -import org.qi4j.api.entity.IdentityGenerator; -import org.qi4j.api.mixin.Mixins; -import org.qi4j.api.service.ServiceComposite; - -@Mixins( GaeIdGeneratorService.Mixin.class ) -public interface GaeIdGeneratorService - extends IdentityGenerator, ServiceComposite -{ - public class Mixin - implements IdentityGenerator - { - private DatastoreService datastore; - private ThreadLocal> range; - - public Mixin() - { - datastore = DatastoreServiceFactory.getDatastoreService(); - range = new ThreadLocal>() - { - @Override - protected Iterator initialValue() - { - return datastore.allocateIds( "qi4j", 100 ).iterator(); - } - }; - } - - @Override - public String generate( Class compositeType ) - { - if( !range.get().hasNext() ) - { - range.set( datastore.allocateIds( "qi4j", 100 ).iterator() ); - } - return "" + range.get().next().getId(); - } - } -} http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreActivation.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreActivation.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreActivation.java deleted file mode 100644 index 7dcfad2..0000000 --- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreActivation.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2012, Paul Merlin. All Rights Reserved. - * - * Licensed 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. - * - */ -package org.qi4j.entitystore.gae2; - -import org.qi4j.api.activation.ActivatorAdapter; -import org.qi4j.api.activation.Activators; -import org.qi4j.api.service.ServiceReference; - -/** - * Activation for GaeEntityStoreMixin. - */ -@Activators( GaeEntityStoreActivation.Activator.class ) -public interface GaeEntityStoreActivation -{ - - void activateGaeEntityStore() - throws Exception; - - class Activator - extends ActivatorAdapter> - { - - @Override - public void afterActivation( ServiceReference activated ) - throws Exception - { - activated.get().activateGaeEntityStore(); - } - - } - -} http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreConfiguration.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreConfiguration.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreConfiguration.java deleted file mode 100644 index 554fdc5..0000000 --- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2009 Niclas Hedhman. - * - * Licensed 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. - */ - -package org.qi4j.entitystore.gae2; - -import org.qi4j.api.configuration.ConfigurationComposite; -import org.qi4j.api.property.Property; - -public interface GaeEntityStoreConfiguration extends ConfigurationComposite -{ - - Property readPolicy(); - - Property deadline(); - - Property entityKind(); -} http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreMixin.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreMixin.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreMixin.java deleted file mode 100644 index 4721ada..0000000 --- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreMixin.java +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright 2009 Niclas Hedhman. - * - * Licensed 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. - */ - -package org.qi4j.entitystore.gae2; - -import com.google.appengine.api.datastore.DatastoreService; -import com.google.appengine.api.datastore.DatastoreServiceConfig; -import com.google.appengine.api.datastore.DatastoreServiceFactory; -import com.google.appengine.api.datastore.Entity; -import com.google.appengine.api.datastore.Key; -import com.google.appengine.api.datastore.KeyFactory; -import com.google.appengine.api.datastore.PreparedQuery; -import com.google.appengine.api.datastore.Query; -import com.google.appengine.api.datastore.QueryResultIterable; -import com.google.appengine.api.datastore.ReadPolicy; -import com.google.appengine.api.datastore.Text; -import com.google.appengine.api.datastore.Transaction; -import java.io.IOException; -import java.io.Reader; -import java.io.StringReader; -import java.io.StringWriter; -import java.io.Writer; -import java.util.concurrent.locks.ReadWriteLock; -import org.qi4j.api.configuration.Configuration; -import org.qi4j.api.entity.EntityDescriptor; -import org.qi4j.api.entity.EntityReference; -import org.qi4j.api.injection.scope.This; -import org.qi4j.api.util.Classes; -import org.qi4j.io.Input; -import org.qi4j.io.Output; -import org.qi4j.io.Receiver; -import org.qi4j.io.Sender; -import org.qi4j.spi.entitystore.EntityNotFoundException; -import org.qi4j.spi.entitystore.EntityStoreException; -import org.qi4j.spi.entitystore.helpers.MapEntityStore; - -import static com.google.appengine.api.datastore.DatastoreServiceConfig.Builder.withReadPolicy; -import static org.qi4j.functional.Iterables.first; - -public class GaeEntityStoreMixin - implements GaeEntityStoreActivation, MapEntityStore -{ - @This - private ReadWriteLock lock; - - @This - private Configuration config; - - private DatastoreService datastore; - private String entityKind; - - @Override - public void activateGaeEntityStore() - throws Exception - { - GaeEntityStoreConfiguration conf = config.get(); - // eventually consistent reads with a 5 second deadline - DatastoreServiceConfig configuration = - withReadPolicy( new ReadPolicy( ReadPolicy.Consistency.valueOf( conf.readPolicy().get().toUpperCase() ) ) ) - .deadline( conf.deadline().get() ); - datastore = DatastoreServiceFactory.getDatastoreService( configuration ); - entityKind = conf.entityKind().get(); - } - - @Override - public Reader get( EntityReference ref ) - throws EntityStoreException - { - - try - { - Key key = KeyFactory.createKey( entityKind, ref.toURI() ); - Entity entity = datastore.get( key ); - Text serializedState = (Text) entity.getProperty( "value" ); - if( serializedState == null ) - { - throw new EntityNotFoundException( ref ); - } - return new StringReader( serializedState.getValue() ); - } - catch( com.google.appengine.api.datastore.EntityNotFoundException e ) - { - e.printStackTrace(); - throw new EntityNotFoundException( ref ); - } - } - - @Override - public void applyChanges( MapChanges changes ) - throws IOException - - { - final Transaction transaction = datastore.beginTransaction(); - try - { - changes.visitMap( new GaeMapChanger( transaction ) ); - transaction.commit(); - } - catch( RuntimeException e ) - { - if( transaction.isActive() ) - { - transaction.rollback(); - } - if( e instanceof EntityStoreException ) - { - throw (EntityStoreException) e; - } - else - { - throw new IOException( e ); - } - } - } - - @Override - public Input entityStates() - { - return new Input() - { - @Override - public void transferTo( Output output ) - throws IOException, ReceiverThrowableType - { - Query query = new Query(); - PreparedQuery preparedQuery = datastore.prepare( query ); - final QueryResultIterable iterable = preparedQuery.asQueryResultIterable(); - - output.receiveFrom( new Sender() - { - @Override - public void sendTo( Receiver receiver ) - throws ReceiverThrowableType, IOException - { - for( Entity entity : iterable ) - { - Text serializedState = (Text) entity.getProperty( "value" ); - receiver.receive( new StringReader( serializedState.getValue() ) ); - } - } - } ); - } - }; - } - - private class GaeMapChanger - implements MapChanger - { - private final Transaction transaction; - - public GaeMapChanger( Transaction transaction ) - { - this.transaction = transaction; - } - - @Override - public Writer newEntity( final EntityReference ref, final EntityDescriptor descriptor ) - { - return new StringWriter( 1000 ) - { - @Override - public void close() - throws IOException - { - super.close(); - Key key = KeyFactory.createKey( entityKind, ref.toURI() ); - Entity entity = new Entity( key ); - Text value = new Text( toString() ); - entity.setUnindexedProperty( "value", value ); - entity.setProperty( "ref", ref.identity() ); - entity.setProperty( "type", Classes.toURI( first( descriptor.types() ) ) ); - datastore.put( transaction, entity ); - } - }; - } - - @Override - public Writer updateEntity( final EntityReference ref, final EntityDescriptor descriptor ) - { - return new StringWriter( 1000 ) - { - @Override - public void close() - throws IOException - { - super.close(); - Key key = KeyFactory.createKey( entityKind, ref.toURI() ); - Entity entity = new Entity( key ); - Text value = new Text( toString() ); - entity.setUnindexedProperty( "value", value ); - entity.setProperty( "ref", ref.identity() ); - entity.setProperty( "type", Classes.toURI( first( descriptor.types() ) ) ); - datastore.put( transaction, entity ); - } - }; - } - - @Override - public void removeEntity( EntityReference ref, EntityDescriptor descriptor ) - throws EntityNotFoundException - { - Key key = KeyFactory.createKey( entityKind, ref.toURI() ); - datastore.delete( transaction, key ); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreService.java ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreService.java b/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreService.java deleted file mode 100644 index ee5f4f3..0000000 --- a/extensions/entitystore-gae/src/main/java/org/qi4j/entitystore/gae2/GaeEntityStoreService.java +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright 2010 Niclas Hedhman - * - * Licensed 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. - */ -package org.qi4j.entitystore.gae2; - -import org.qi4j.api.concern.Concerns; -import org.qi4j.api.configuration.Configuration; -import org.qi4j.api.mixin.Mixins; -import org.qi4j.api.service.ServiceComposite; -import org.qi4j.library.locking.LockingAbstractComposite; -import org.qi4j.spi.entitystore.ConcurrentModificationCheckConcern; -import org.qi4j.spi.entitystore.EntityStateVersions; -import org.qi4j.spi.entitystore.EntityStore; -import org.qi4j.spi.entitystore.StateChangeNotificationConcern; -import org.qi4j.spi.entitystore.helpers.JSONMapEntityStoreActivation; -import org.qi4j.spi.entitystore.helpers.JSONMapEntityStoreMixin; -import org.qi4j.spi.entitystore.helpers.StateStore; - -/** - * EntityStore service backed by Google AppEngine's low-level store. - *

Based on @{@link JSONMapEntityStoreMixin}.

- */ -@Concerns( { StateChangeNotificationConcern.class, ConcurrentModificationCheckConcern.class } ) -@Mixins( { JSONMapEntityStoreMixin.class, GaeEntityStoreMixin.class } ) -public interface GaeEntityStoreService - extends GaeEntityStoreActivation, - JSONMapEntityStoreActivation, - EntityStore, - EntityStateVersions, - StateStore, - ServiceComposite, - LockingAbstractComposite, - Configuration -{ -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/src/main/resources/org.qi4j.entitystore.gae2/GaeEntityStoreService.properties ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/src/main/resources/org.qi4j.entitystore.gae2/GaeEntityStoreService.properties b/extensions/entitystore-gae/src/main/resources/org.qi4j.entitystore.gae2/GaeEntityStoreService.properties deleted file mode 100644 index 51c8842..0000000 --- a/extensions/entitystore-gae/src/main/resources/org.qi4j.entitystore.gae2/GaeEntityStoreService.properties +++ /dev/null @@ -1,5 +0,0 @@ - - -readPolicy=eventual -deadline()=0.5 -entityKind=qi4j-json http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-gae/src/test/java/org/qi4j/entitystore/gae/readme.html ---------------------------------------------------------------------- diff --git a/extensions/entitystore-gae/src/test/java/org/qi4j/entitystore/gae/readme.html b/extensions/entitystore-gae/src/test/java/org/qi4j/entitystore/gae/readme.html deleted file mode 100644 index 5887e10..0000000 --- a/extensions/entitystore-gae/src/test/java/org/qi4j/entitystore/gae/readme.html +++ /dev/null @@ -1,12 +0,0 @@ - - -

EntityStore for Google App Engine

- -

It is not possible to test this code fully without running within the Google AppEngine itself. Therefor the -tests has been moved to their own module in the qi4j-tests GIT repository. The tests are not run as standard JUnit -tests, but as a Web application itself. It uses the standard Qi4j Entity Store test suite, but the runner is -special built for this purpose and the result comes out as a simple web page.

- -

You will also need a Google AppEngine account to run them.

- - \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-neo4j/NOTICE.txt ---------------------------------------------------------------------- diff --git a/extensions/entitystore-neo4j/NOTICE.txt b/extensions/entitystore-neo4j/NOTICE.txt deleted file mode 100644 index 478e958..0000000 --- a/extensions/entitystore-neo4j/NOTICE.txt +++ /dev/null @@ -1,27 +0,0 @@ -Copyright 2008 Neo Technology, http://neotechnology.com. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this component 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. - - -Please note that this component depends on Neo4J (http://neo4j.org) -which is distributed under the terms of the GNU Affero General -Public License as published by the Free Software Foundation, either -version 3 of the License, or (at your option) any later version. -Neo Technology also provides a distribution of Neo4J under a -commercial license at http://neotechnology.com. - -Any software that depends on Neo4J and this component is therefore -subjected to any additional license details stated by the License -of Neo4J. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-neo4j/build.gradle ---------------------------------------------------------------------- diff --git a/extensions/entitystore-neo4j/build.gradle b/extensions/entitystore-neo4j/build.gradle deleted file mode 100644 index 4fff878..0000000 --- a/extensions/entitystore-neo4j/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ - -description = "Qi4j Neo4j EntityStore Extension" - -jar { manifest { name = "Qi4j Extension - EntityStore - Neo4j" }} - -dependencies { - compile(project(":org.qi4j.core:org.qi4j.core.spi")) - compile(project(":org.qi4j.libraries:org.qi4j.library.fileconfig")) - compile(libraries.neo4j) - - testCompile(project(":org.qi4j.core:org.qi4j.core.testsupport")) - testCompile(project(":org.qi4j.extensions:org.qi4j.extension.valueserialization-orgjson")) - - testRuntime(project(":org.qi4j.core:org.qi4j.core.runtime")) - testRuntime(libraries.logback) -} - http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-neo4j/dev-status.xml ---------------------------------------------------------------------- diff --git a/extensions/entitystore-neo4j/dev-status.xml b/extensions/entitystore-neo4j/dev-status.xml deleted file mode 100644 index 8078e77..0000000 --- a/extensions/entitystore-neo4j/dev-status.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - beta - - - brief - - - some - - - ALv2 - AGPLv3 - - http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-neo4j/license-explain.txt ---------------------------------------------------------------------- diff --git a/extensions/entitystore-neo4j/license-explain.txt b/extensions/entitystore-neo4j/license-explain.txt deleted file mode 100644 index f3ed0b5..0000000 --- a/extensions/entitystore-neo4j/license-explain.txt +++ /dev/null @@ -1,68 +0,0 @@ - -Please note that this module has a dependency on a GNU Affero General Public License -version 3 (AGPLv3), not to be mistaken for the GNU General Public License version 3 -(GPLv3). The main difference is that "distribution" in GPLv3 is extended to include -"usage", for instance if an application can be used from a web service, the user -has roughly the equivalent rights of "distribution" under GPLv3. - -To clarify the intent of Neo4j licensing in the context of Qi4j's Neo4j Entity Store -the following mail from qi4j-dev@lists.ops4j.org captures the understanding of -the license. Please note that this is not legal advice, and if in doubt, please -consult your legal counsel. - -- o - o - o - o - o - - -On Mon, Jul 28, 2008 at 8:35 AM, Niclas Hedhman wrote: -> -> Everyone (especially Emil), -> -> Please READ the NOTICE.txt before using the "Entity Store - Neo4j". Although -> the EnityStore itself is under the Apache License ver 2.0, it has a -> dependency on Neo4j itself, which is licensed under GNU Affero General Public -> License version 3 or later. -> -> In essence, this means that you are allowed to USE the combined work for -> yourself without limitations, as long as noone else uses it, directly or -> indirectly. That means, if you create an application and distribute, or if -> you put an application on a web server, with users accessing it, then you -> MUST provide the sources of the combined work to anyone asking for it. - -Correct. - -> -> There is a "gray zone" which I would like to hear the clarification by Emil. -> -> -> Person A develops some funky closed-source web application, based on Qi4j. -> -> Person B buys that application, but configures it to use the Neo4j Entity -> Store and the Neo4j Engine. -> -> -> Person A is not violating any license. Person B is not violating the license -> received from Person A. But is Person B violating the GNU Affero General -> Public License, by not having the authority to provide the sources for the -> web application product itself??? - -Yes. - -Person B is only allowed to use Neo4j if they follow the terms in the -license under which they received it. In Neo4j's case, they have two -choices: use it under the AGPLv3 license or the commercial license. If -they use Neo4j under AGPLv3, then in order to comply with the terms of -the AGPLv3 they must provide the full source code to the combined work -(including the webapp's code) to any users of said webapp. In that -case, they can't comply with one of the terms (freedom 1, access to -source code) so they won't be granted the rights of any of the other -terms in the license (for example freedom 0, the freedom to run). - -If they can't comply with that for whatever reason (in this case, -because person A did not grant them that freedom), they're unable to -use Neo4j under the AGPLv3. They can of course purchase Neo4j under a -commercial license (which gives them the flexibility to e.g. use it -with proprietary code, along with indemnification and support etc) or -swap in something else. - -IANAL, but this captures our intent. I've bounced this scenario off of -licensing@fsf.org and this is their interpretation as well (except -it's not legal advice from them either, of course). \ No newline at end of file http://git-wip-us.apache.org/repos/asf/zest-qi4j/blob/70f25289/extensions/entitystore-neo4j/licenses/neo4j-commercial.license ---------------------------------------------------------------------- diff --git a/extensions/entitystore-neo4j/licenses/neo4j-commercial.license b/extensions/entitystore-neo4j/licenses/neo4j-commercial.license deleted file mode 100644 index b526288..0000000 --- a/extensions/entitystore-neo4j/licenses/neo4j-commercial.license +++ /dev/null @@ -1,3 +0,0 @@ - -Contact Neo Technology AB through a mail to sales@neotechnology.com for details -of the commercial licenses available and price quotes. \ No newline at end of file