You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by pa...@apache.org on 2015/04/20 10:04:22 UTC
[3/4] zest-sandbox git commit: Cleanup Zest Sandbox - Remove dead
projects
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/JavaSpacesClientMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/JavaSpacesClientMixin.java b/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/JavaSpacesClientMixin.java
deleted file mode 100644
index 13d03bb..0000000
--- a/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/JavaSpacesClientMixin.java
+++ /dev/null
@@ -1,483 +0,0 @@
-/*
- * Copyright 2008 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.library.spaces.javaspaces;
-
-import net.jini.config.ConfigurationException;
-import net.jini.config.ConfigurationFile;
-import net.jini.core.entry.UnusableEntryException;
-import net.jini.core.lease.LeaseDeniedException;
-import net.jini.core.lookup.ServiceTemplate;
-import net.jini.core.transaction.Transaction;
-import net.jini.core.transaction.TransactionException;
-import net.jini.core.transaction.TransactionFactory;
-import net.jini.core.transaction.server.TransactionManager;
-import net.jini.discovery.DiscoveryEvent;
-import net.jini.discovery.DiscoveryListener;
-import net.jini.discovery.DiscoveryManagement;
-import net.jini.discovery.LookupDiscoveryManager;
-import net.jini.lookup.LookupCache;
-import net.jini.lookup.ServiceDiscoveryEvent;
-import net.jini.lookup.ServiceDiscoveryListener;
-import net.jini.lookup.ServiceDiscoveryManager;
-import net.jini.space.JavaSpace05;
-import net.jini.space.MatchSet;
-import org.qi4j.api.configuration.Configuration;
-import org.qi4j.api.injection.scope.This;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.library.spaces.Space;
-import org.qi4j.library.spaces.SpaceException;
-import org.qi4j.library.spaces.SpaceTransaction;
-
-import java.io.*;
-import java.rmi.RemoteException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Stack;
-import java.util.StringTokenizer;
-
-public class JavaSpacesClientMixin
- implements Space, Activatable
-{
- @This private Configuration<JavaSpacesClientConfiguration> my;
- private ServiceHolder<JavaSpace05> spaceService;
- private ServiceHolder<TransactionManager> transactionService;
- private StackThreadLocal<TransactionProxy> transactionStack;
-
- public JavaSpacesClientMixin()
- {
- transactionStack = new StackThreadLocal<TransactionProxy>();
- }
-
- public void write( String id, String entry )
- {
- synchronized( this )
- {
- if( spaceService.service != null )
- {
- try
- {
- StorageEntry storageEntry = new StorageEntry( id, entry );
- spaceService.service.write( storageEntry, currentTransaction(), 6000 );
- }
- catch( TransactionException e )
- {
- e.printStackTrace(); // Can not happen without own transaction.
- }
- catch( RemoteException e )
- {
- throw new SpaceException( "Remote problems: " + e.getMessage(), e );
- }
- }
- }
- }
-
- public Serializable take( String id, long timeout )
- {
- synchronized( this )
- {
- if( spaceService.service != null )
- {
- try
- {
- StorageEntry entry = (StorageEntry) spaceService.service.take( new StorageEntry( id, null ), currentTransaction(), 6000 );
- if( entry == null )
- {
- return null;
- }
- return entry.data();
- }
- catch( TransactionException e )
- {
- e.printStackTrace(); // Can not happen without own transaction.
- }
- catch( RemoteException e )
- {
- throw new SpaceException( "Remote problems: " + e.getMessage(), e );
- }
- catch( UnusableEntryException e )
- {
- e.printStackTrace();
- }
- catch( InterruptedException e )
- {
- e.printStackTrace();
- }
- }
- }
- return null;
- }
-
- public String takeIfExists( String id )
- {
- synchronized( this )
- {
- if( spaceService.service != null )
- {
- try
- {
- StorageEntry entry = (StorageEntry) spaceService.service.takeIfExists( new StorageEntry( id, null ), currentTransaction(), 6000 );
- if( entry == null )
- {
- return null;
- }
- return entry.data();
- }
- catch( TransactionException e )
- {
- e.printStackTrace(); // Can not happen without own transaction.
- }
- catch( RemoteException e )
- {
- throw new SpaceException( "Remote problems: " + e.getMessage(), e );
- }
- catch( UnusableEntryException e )
- {
- e.printStackTrace();
- }
- catch( InterruptedException e )
- {
- e.printStackTrace();
- }
- }
- return null;
- }
- }
-
- public Serializable read( String id, long timeout )
- {
- synchronized( this )
- {
- if( spaceService.service != null )
- {
- try
- {
- StorageEntry entry = (StorageEntry) spaceService.service.read( new StorageEntry( id, null ), currentTransaction(), timeout );
- if( entry == null )
- {
- return null;
- }
- return entry.data();
- }
- catch( TransactionException e )
- {
- e.printStackTrace(); // Can not happen without own transaction.
- }
- catch( RemoteException e )
- {
- throw new SpaceException( "Remote problems: " + e.getMessage(), e );
- }
- catch( UnusableEntryException e )
- {
- e.printStackTrace();
- }
- catch( InterruptedException e )
- {
- e.printStackTrace();
- }
- }
- }
- return null;
- }
-
- public String readIfExists( String id )
- {
- synchronized( this )
- {
- if( spaceService.service != null )
- {
-
- try
- {
- StorageEntry entry = (StorageEntry) spaceService.service.readIfExists( new StorageEntry( id, null ), currentTransaction(), 6000 );
- if( entry == null )
- {
- return null;
- }
- return entry.data();
- }
- catch( TransactionException e )
- {
- e.printStackTrace(); // Can not happen without own transaction.
- }
- catch( RemoteException e )
- {
- throw new SpaceException( "Remote problems: " + e.getMessage(), e );
- }
- catch( UnusableEntryException e )
- {
- e.printStackTrace();
- }
- catch( InterruptedException e )
- {
- e.printStackTrace();
- }
- }
- }
- return null;
- }
-
- public SpaceTransaction newTransaction()
- {
- synchronized( this )
- {
- if( transactionService.service != null )
- {
- try
- {
- Transaction.Created created = TransactionFactory.create( transactionService.service, 60000 );
- Transaction transaction = created.transaction;
- System.out.println( "NEW: " + transaction );
- TransactionProxy transactionProxy = new TransactionProxy( transaction, this );
- transactionStack.get().push( transactionProxy );
- return transactionProxy;
- }
- catch( LeaseDeniedException e )
- {
- e.printStackTrace();
- }
- catch( RemoteException e )
- {
- e.printStackTrace();
- }
- }
- return new NullTransactionProxy();
- }
- }
-
- public boolean isReady()
- {
- return spaceService.service != null && transactionService.service != null;
- }
-
- public void activate()
- throws Exception
- {
- String groupConfig = my.configuration().groups().get();
- System.out.println( "GROUPS: " + groupConfig );
- String[] groups = convert( groupConfig );
- spaceService = initializeLookup( groups, JavaSpace05.class );
- transactionService = initializeLookup( groups, TransactionManager.class );
- }
-
- private String[] convert( String data )
- {
- if( data == null )
- {
- return new String[0];
- }
- StringTokenizer st = new StringTokenizer( data, ",", false );
- ArrayList<String> result = new ArrayList<String>();
- while( st.hasMoreTokens() )
- {
- String item = st.nextToken().trim();
- result.add( item );
- }
- String[] retVal = new String[result.size()];
- return result.toArray( retVal );
- }
-
- public void passivate()
- throws Exception
- {
- spaceService.lookupCache.terminate();
- transactionService.lookupCache.terminate();
- }
-
- static <T> ServiceHolder<T> initializeLookup( String[] groups, Class<T> type )
- throws IOException
- {
- ClassLoader classloader = JavaSpacesClientMixin.class.getClassLoader();
- InputStream in = JavaSpacesClientMixin.class.getResourceAsStream( "jini.config" );
- Reader reader = new InputStreamReader( in );
- String[] options = new String[0];
- DiscoveryManagement dm = null;
- try
- {
- net.jini.config.Configuration config = new ConfigurationFile( reader, options, classloader );
- dm = new LookupDiscoveryManager( groups, null, null, config );
- }
- catch( ConfigurationException e )
- {
- e.printStackTrace();
- }
- ServiceDiscoveryManager sdm = new ServiceDiscoveryManager( dm, null );
- Class[] types = new Class[]{ type };
- ServiceTemplate template = new ServiceTemplate( null, types, null );
- LookupCache lookupCache = sdm.createLookupCache( template, null, null );
- return new ServiceHolder<T>( dm, lookupCache );
- }
-
- Transaction currentTransaction()
- {
- Stack<TransactionProxy> curStack = transactionStack.get();
- if( curStack.size() == 0 )
- {
- System.err.println( "WARNING: Transaction is null." );
- return null;
- }
- TransactionProxy proxy = curStack.peek();
- if( proxy == null )
- {
- System.err.println( "WARNING: Transaction is null." );
- return null;
- }
- else if( proxy.transaction == null )
- {
- System.err.println( "WARNING: Transaction is null." );
- }
- Transaction transaction = proxy.transaction;
- System.out.println( "LOOKUP: " + transaction );
- return transaction;
- }
-
- void removeTransaction( TransactionProxy transaction )
- {
- Stack<TransactionProxy> curStack = transactionStack.get();
- curStack.remove( transaction );
- }
-
- public Iterator<String> iterator()
- {
- ArrayList templates = new ArrayList();
- templates.add( new StorageEntry(null, null) );
- try
- {
- Transaction txn = currentTransaction();
- MatchSet matchSet = spaceService.service.contents( templates, txn, 60000, 1000 );
- return new EntryIterator( matchSet );
- }
- catch( TransactionException e )
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- catch( RemoteException e )
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- return null;
- }
-
- static class ServiceHolder<T>
- implements DiscoveryListener
- {
- private DiscoveryManagement dm;
- private LookupCache lookupCache;
- T service;
-
- public ServiceHolder( DiscoveryManagement dm, LookupCache lookupCache )
- {
- this.dm = dm;
- this.lookupCache = lookupCache;
- this.dm.addDiscoveryListener( this );
- lookupCache.addListener( new ServiceDiscoveryListener()
- {
- public void serviceAdded( ServiceDiscoveryEvent event )
- {
- System.out.println( "Service Added: " + event );
- service = (T) event.getPostEventServiceItem().service;
- }
-
- public void serviceRemoved( ServiceDiscoveryEvent event )
- {
- System.out.println( "Service Removed: " + event );
- service = null;
- }
-
- public void serviceChanged( ServiceDiscoveryEvent event )
- {
- System.out.println( "Service Changed: " + event );
- }
- } );
-
- }
-
- public void dispose()
- {
- dm.removeDiscoveryListener( this );
- }
-
- public void discovered( DiscoveryEvent e )
- {
- System.out.println( "Discovered: " + e.getGroups() );
- }
-
- public void discarded( DiscoveryEvent e )
- {
- System.out.println( "Discarded: " + e.getGroups() );
- }
- }
-
- private static class EntryIterator
- implements Iterator<String>
- {
- private MatchSet matchSet;
- private StorageEntry nextEntry;
-
- public EntryIterator( MatchSet matchSet )
- {
- this.matchSet = matchSet;
- try
- {
- nextEntry = getNext( matchSet );
- }
- catch( RemoteException e )
- {
- e.printStackTrace();
- }
- catch( UnusableEntryException e )
- {
- e.printStackTrace();
- }
- }
-
- private StorageEntry getNext( MatchSet matchSet )
- throws RemoteException, UnusableEntryException
- {
- StorageEntry storageEntry = (StorageEntry) matchSet.next();
- return storageEntry;
- }
-
- public boolean hasNext()
- {
- return nextEntry != null;
- }
-
- public String next()
- {
- String result = nextEntry.data();
- try
- {
- nextEntry = getNext( matchSet );
- }
- catch( RemoteException e )
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- catch( UnusableEntryException e )
- {
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- return result;
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/JavaSpacesClientService.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/JavaSpacesClientService.java b/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/JavaSpacesClientService.java
deleted file mode 100644
index ac32046..0000000
--- a/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/JavaSpacesClientService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2008 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.library.spaces.javaspaces;
-
-import org.qi4j.api.mixin.Mixins;
-import org.qi4j.api.service.Activatable;
-import org.qi4j.api.service.ServiceComposite;
-import org.qi4j.library.spaces.Space;
-
-@Mixins( { JavaSpacesClientMixin.class } )
-public interface JavaSpacesClientService extends Space, Activatable, ServiceComposite
-{
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/NullTransactionProxy.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/NullTransactionProxy.java b/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/NullTransactionProxy.java
deleted file mode 100644
index ecf59e8..0000000
--- a/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/NullTransactionProxy.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2008 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.library.spaces.javaspaces;
-
-import org.qi4j.library.spaces.SpaceTransaction;
-
-final class NullTransactionProxy
- implements SpaceTransaction
-{
- NullTransactionProxy()
- {
- }
-
- public void commit()
- {
- }
-
- public void abort()
- {
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/StackThreadLocal.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/StackThreadLocal.java b/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/StackThreadLocal.java
deleted file mode 100644
index 9fa0952..0000000
--- a/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/StackThreadLocal.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2008 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.library.spaces.javaspaces;
-
-import java.util.Stack;
-
-public class StackThreadLocal<E>
- extends ThreadLocal<Stack<E>>
-{
- protected Stack<E> initialValue()
- {
- return new Stack<E>();
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/StorageEntry.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/StorageEntry.java b/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/StorageEntry.java
deleted file mode 100644
index ca36a65..0000000
--- a/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/StorageEntry.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2008 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.library.spaces.javaspaces;
-
-import net.jini.core.entry.Entry;
-
-public final class StorageEntry
- implements Entry
-{
- public String identity;
- public String payload;
-
- public StorageEntry()
- {
- }
-
- public StorageEntry( String id, String data )
- {
- identity = id;
- payload = data;
- }
-
- public String identity()
- {
- return identity;
- }
-
- public String data()
- {
- return payload;
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/TransactionProxy.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/TransactionProxy.java b/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/TransactionProxy.java
deleted file mode 100644
index ce094cf..0000000
--- a/extensions/entitystore-javaspaces/src/main/java/org/qi4j/library/spaces/javaspaces/TransactionProxy.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2008 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.library.spaces.javaspaces;
-
-import net.jini.core.transaction.CannotAbortException;
-import net.jini.core.transaction.CannotCommitException;
-import net.jini.core.transaction.Transaction;
-import net.jini.core.transaction.UnknownTransactionException;
-import org.qi4j.library.spaces.SpaceException;
-import org.qi4j.library.spaces.SpaceTransaction;
-
-import java.rmi.RemoteException;
-
-final class TransactionProxy
- implements SpaceTransaction
-{
- Transaction transaction;
- private JavaSpacesClientMixin javaspacesMixin;
-
- TransactionProxy( Transaction transaction, JavaSpacesClientMixin mixin )
- {
- this.transaction = transaction;
- javaspacesMixin = mixin;
- }
-
- public void commit()
- {
- try
- {
- System.out.println( "COMMIT: " + transaction );
- transaction.commit();
- javaspacesMixin.removeTransaction( this );
- }
- catch( UnknownTransactionException e )
- {
- throw new SpaceException( "Can not commit: " + e.getMessage(), e );
- }
- catch( CannotCommitException e )
- {
- throw new SpaceException( "Can not commit: " + e.getMessage(), e );
- }
- catch( RemoteException e )
- {
- throw new SpaceException( "Can not commit: " + e.getMessage(), e );
- }
- }
-
- public void abort()
- {
- try
- {
- System.out.println( "ABORT: " + transaction );
- transaction.abort();
- javaspacesMixin.removeTransaction( this );
- }
- catch( UnknownTransactionException e )
- {
- throw new SpaceException( "Can not abort: " + e.getMessage(), e );
- }
- catch( CannotAbortException e )
- {
- throw new SpaceException( "Can not abort: " + e.getMessage(), e );
- }
- catch( RemoteException e )
- {
- throw new SpaceException( "Can not abort: " + e.getMessage(), e );
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/entitystore-javaspaces/src/main/resources/org/qi4j/library/spaces/javaspaces/JavaSpacesClientService.properties
----------------------------------------------------------------------
diff --git a/extensions/entitystore-javaspaces/src/main/resources/org/qi4j/library/spaces/javaspaces/JavaSpacesClientService.properties b/extensions/entitystore-javaspaces/src/main/resources/org/qi4j/library/spaces/javaspaces/JavaSpacesClientService.properties
deleted file mode 100644
index ea0e4e9..0000000
--- a/extensions/entitystore-javaspaces/src/main/resources/org/qi4j/library/spaces/javaspaces/JavaSpacesClientService.properties
+++ /dev/null
@@ -1 +0,0 @@
-groups=qi4j
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/entitystore-javaspaces/src/main/resources/org/qi4j/library/spaces/javaspaces/jini.config
----------------------------------------------------------------------
diff --git a/extensions/entitystore-javaspaces/src/main/resources/org/qi4j/library/spaces/javaspaces/jini.config b/extensions/entitystore-javaspaces/src/main/resources/org/qi4j/library/spaces/javaspaces/jini.config
deleted file mode 100644
index 0a963e3..0000000
--- a/extensions/entitystore-javaspaces/src/main/resources/org/qi4j/library/spaces/javaspaces/jini.config
+++ /dev/null
@@ -1,9 +0,0 @@
-
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-
-net.jini.discovery.LookupDiscovery
-{
- multicastInterfaces = new NetworkInterface[] { NetworkInterface.getByInetAddress( InetAddress.getByName( "127.0.0.1" ) ) };
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/entitystore-javaspaces/src/test/java/org/qi4j/entitystore/javaspaces/JavaSpacesEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-javaspaces/src/test/java/org/qi4j/entitystore/javaspaces/JavaSpacesEntityStoreTest.java b/extensions/entitystore-javaspaces/src/test/java/org/qi4j/entitystore/javaspaces/JavaSpacesEntityStoreTest.java
deleted file mode 100644
index edd97f9..0000000
--- a/extensions/entitystore-javaspaces/src/test/java/org/qi4j/entitystore/javaspaces/JavaSpacesEntityStoreTest.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/* Copyright 2008 Jan Kronquist.
- *
- * 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.javaspaces;
-
-import java.io.File;
-import java.security.AllPermission;
-import java.security.CodeSource;
-import java.security.PermissionCollection;
-import java.security.Permissions;
-import java.security.Policy;
-import net.jini.security.policy.DynamicPolicyProvider;
-import org.junit.After;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.qi4j.api.common.Visibility;
-import org.qi4j.api.unitofwork.UnitOfWorkCompletionException;
-import org.qi4j.bootstrap.AssemblyException;
-import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.entitystore.memory.MemoryEntityStoreService;
-import org.qi4j.library.http.JettyServiceAssembler;
-import org.qi4j.library.jini.javaspaces.JiniJavaSpacesServiceAssembler;
-import org.qi4j.library.jini.lookup.JiniLookupServiceAssembler;
-import org.qi4j.library.jini.transaction.JiniTransactionServiceAssembler;
-import org.qi4j.library.spaces.javaspaces.JavaSpacesClientConfiguration;
-import org.qi4j.library.spaces.javaspaces.JavaSpacesClientService;
-import org.qi4j.spi.uuid.UuidIdentityGeneratorService;
-import org.qi4j.test.entity.AbstractEntityStoreTest;
-
-/**
- * JavaSpaces EntityStore test
- */
-@Ignore
-public class JavaSpacesEntityStoreTest
- extends AbstractEntityStoreTest
-{
- static
- {
- Policy basePolicy = new AllPolicy();
- DynamicPolicyProvider policyProvider = new DynamicPolicyProvider( basePolicy );
- Policy.setPolicy( policyProvider );
- }
-
- @SuppressWarnings( "unchecked" )
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- super.assemble( module );
- module.addServices( JavaSpacesEntityStoreService.class,
- MemoryEntityStoreService.class,
- UuidIdentityGeneratorService.class )
- .instantiateOnStartup();
-
- ModuleAssembly configModule = module.layerAssembly().moduleAssembly( "JavaSpacesConfiguration" );
- new JiniTransactionServiceAssembler().assemble( configModule );
- new JiniLookupServiceAssembler().assemble( configModule );
- new JiniJavaSpacesServiceAssembler().assemble( configModule );
- new JettyServiceAssembler().assemble( configModule );
- configModule.addServices( JavaSpacesClientService.class ).visibleIn( Visibility.layer ).instantiateOnStartup();
- configModule.addEntities( JavaSpacesClientConfiguration.class );
- configModule.addServices( MemoryEntityStoreService.class ).instantiateOnStartup();
- configModule.addServices( MemoryEntityStoreService.class,
- UuidIdentityGeneratorService.class );
- }
-
- @Override
- @After
- public void tearDown()
- throws Exception
- {
- super.tearDown();
- delete( new File( "qi4jtemp" ) );
- Thread.sleep( 1000 );
- }
-
- @Test
- @Override
- public void givenConcurrentUnitOfWorksWhenUoWCompletesThenCheckConcurrentModification()
- throws UnitOfWorkCompletionException
- {
- super.givenConcurrentUnitOfWorksWhenUoWCompletesThenCheckConcurrentModification();
- }
-
- private void delete( File dir )
- {
- File[] files = dir.listFiles();
- if( files == null )
- {
- return;
- }
- for( File file : files )
- {
- if( file.isDirectory() )
- {
- delete( file );
- }
- file.delete();
- }
- dir.delete();
- }
-
- @Test
- public void enableTests()
- {
- }
-
- public static class AllPolicy
- extends Policy
- {
-
- public AllPolicy()
- {
- }
-
- public PermissionCollection getPermissions( CodeSource codeSource )
- {
- Permissions allPermission;
- allPermission = new Permissions();
- allPermission.add( new AllPermission() );
- return allPermission;
- }
-
- public void refresh()
- {
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/entitystore-javaspaces/src/test/java/org/qi4j/entitystore/javaspaces/JavaspacesTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-javaspaces/src/test/java/org/qi4j/entitystore/javaspaces/JavaspacesTest.java b/extensions/entitystore-javaspaces/src/test/java/org/qi4j/entitystore/javaspaces/JavaspacesTest.java
deleted file mode 100644
index 18c1ad1..0000000
--- a/extensions/entitystore-javaspaces/src/test/java/org/qi4j/entitystore/javaspaces/JavaspacesTest.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright 2008 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.javaspaces;
-
-import java.io.IOException;
-import java.security.AllPermission;
-import java.security.CodeSource;
-import java.security.PermissionCollection;
-import java.security.Permissions;
-import java.security.Policy;
-import java.util.logging.FileHandler;
-import java.util.logging.Formatter;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.logging.SimpleFormatter;
-import net.jini.security.policy.DynamicPolicyProvider;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.qi4j.api.injection.scope.Service;
-import org.qi4j.bootstrap.AssemblyException;
-import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.entitystore.memory.MemoryEntityStoreService;
-import org.qi4j.library.http.JettyServiceAssembler;
-import org.qi4j.library.jini.javaspaces.JiniJavaSpacesServiceAssembler;
-import org.qi4j.library.jini.lookup.JiniLookupServiceAssembler;
-import org.qi4j.library.jini.transaction.JiniTransactionServiceAssembler;
-import org.qi4j.library.spaces.Space;
-import org.qi4j.library.spaces.javaspaces.JavaSpacesClientAssembler;
-import org.qi4j.test.AbstractQi4jTest;
-
-@Ignore( "Implementation is not working yet." )
-public class JavaspacesTest extends AbstractQi4jTest
-{
- private Space qi4jspace;
-
- static
- {
- Logger logger = Logger.getLogger( "" );
- Handler handler = null;
- try
- {
- handler = new FileHandler( "output.log" );
- Formatter formatter = new SimpleFormatter();
- handler.setFormatter( formatter );
- }
- catch( IOException e )
- {
- e.printStackTrace();
- }
- logger.addHandler( handler );
- logger.setLevel( Level.FINEST );
- }
-
- protected Space space()
- {
- if( qi4jspace == null )
- {
- qi4jspace = objectBuilderFactory.newObject( SpaceHolder.class ).getSpace();
- }
- return qi4jspace;
- }
-
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- if( System.getSecurityManager() == null )
- {
- Policy allPolicy = new TestPolicyAllPermissions();
- Policy.setPolicy( new DynamicPolicyProvider( allPolicy ) );
- System.setSecurityManager( new SecurityManager() );
- }
- new JiniLookupServiceAssembler().assemble( module );
- new JiniTransactionServiceAssembler().assemble( module );
- new JiniJavaSpacesServiceAssembler().assemble( module );
- new JettyServiceAssembler().assemble( module );
- module.addServices( MemoryEntityStoreService.class );
- new JavaSpacesClientAssembler().assemble( module );
- module.addObjects( SpaceHolder.class );
- }
-
- @Test
- public void dummyTest()
- {
- }
-
- public static class SpaceHolder
- {
- @Service private Space space;
-
- public Space getSpace()
- {
- synchronized( this )
- {
- int count = 1000;
- while( !space.isReady() && count > 0 )
- {
- try
- {
- wait( 5 );
- count--;
- }
- catch( InterruptedException e )
- {
- e.printStackTrace();
- }
- }
- if( !space.isReady() )
- {
- throw new RuntimeException( "Can not find the JavaSpace." );
- }
- }
- return space;
- }
- }
-
- public static class TestPolicyAllPermissions extends Policy
- {
- public PermissionCollection getPermissions( CodeSource codeSource )
- {
- Permissions permissions;
- permissions = new Permissions();
- permissions.add( new AllPermission() );
- return permissions;
- }
-
- public void refresh()
- {
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/entitystore-javaspaces/src/test/resources/org/qi4j/entitystore/javaspaces/JavaSpacesEntityStoreService.properties
----------------------------------------------------------------------
diff --git a/extensions/entitystore-javaspaces/src/test/resources/org/qi4j/entitystore/javaspaces/JavaSpacesEntityStoreService.properties b/extensions/entitystore-javaspaces/src/test/resources/org/qi4j/entitystore/javaspaces/JavaSpacesEntityStoreService.properties
deleted file mode 100644
index 9c3e86b..0000000
--- a/extensions/entitystore-javaspaces/src/test/resources/org/qi4j/entitystore/javaspaces/JavaSpacesEntityStoreService.properties
+++ /dev/null
@@ -1 +0,0 @@
-uri=/./Qi4jSpace?groups=qi4j
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/entitystore-javaspaces/src/test/resources/org/qi4j/library/http/JettyService.properties
----------------------------------------------------------------------
diff --git a/extensions/entitystore-javaspaces/src/test/resources/org/qi4j/library/http/JettyService.properties b/extensions/entitystore-javaspaces/src/test/resources/org/qi4j/library/http/JettyService.properties
deleted file mode 100644
index 7a1adb8..0000000
--- a/extensions/entitystore-javaspaces/src/test/resources/org/qi4j/library/http/JettyService.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-port=8040
-hostName=127.0.0.1
-resourcePath=/
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/bootstrap/osgi.bundle
----------------------------------------------------------------------
diff --git a/extensions/osgi/bootstrap/osgi.bundle b/extensions/osgi/bootstrap/osgi.bundle
deleted file mode 100644
index a8bd9f6..0000000
--- a/extensions/osgi/bootstrap/osgi.bundle
+++ /dev/null
@@ -1,20 +0,0 @@
-Bundle-Activator: org.qi4j.osgi.bootstrap.Activator
-
-Private-Package: org.qi4j.osgi.bootstrap
-
-Ignore-Package: com_cenqua_clover
-
-Import-Package: org.osgi.framework, \
- org.qi4j.api.common, \
- org.qi4j.api.composite, \
- org.qi4j.api.entity, \
- org.qi4j.api.injection.scope, \
- org.qi4j.api.mixin, \
- org.qi4j.api.property, \
- org.qi4j.api.structure, \
- org.qi4j.bootstrap, \
- org.qi4j.entitystore.memory, \
- org.qi4j.spi.entitystore.helpers, \
- org.qi4j.spi.structure
-
-Export-Package:
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/bootstrap/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/osgi/bootstrap/pom.xml b/extensions/osgi/bootstrap/pom.xml
deleted file mode 100644
index f0430f3..0000000
--- a/extensions/osgi/bootstrap/pom.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.qi4j.osgi</groupId>
- <artifactId>org.qi4j.core.osgi-test</artifactId>
- <version>0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.qi4j.osgi</groupId>
- <artifactId>qi4j-osgi-bootstrap</artifactId>
- <name>Qi4j Core - OSGi Bootstrap</name>
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <version>1.2.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.qi4j.core</groupId>
- <artifactId>org.qi4j.core.api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.qi4j.core</groupId>
- <artifactId>org.qi4j.core.bootstrap</artifactId>
- </dependency>
- <dependency>
- <groupId>org.qi4j.core</groupId>
- <artifactId>org.qi4j.core.spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.qi4j.core</groupId>
- <artifactId>org.qi4j.core.runtime</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.swissbox</groupId>
- <artifactId>pax-swissbox-core</artifactId>
- <version>1.2.0</version>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.swissbox</groupId>
- <artifactId>pax-swissbox-extender</artifactId>
- <version>1.2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>1.2.0</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/bootstrap/src/main/java/org/qi4j/osgi/bootstrap/Activator.java
----------------------------------------------------------------------
diff --git a/extensions/osgi/bootstrap/src/main/java/org/qi4j/osgi/bootstrap/Activator.java b/extensions/osgi/bootstrap/src/main/java/org/qi4j/osgi/bootstrap/Activator.java
deleted file mode 100644
index 0b884b2..0000000
--- a/extensions/osgi/bootstrap/src/main/java/org/qi4j/osgi/bootstrap/Activator.java
+++ /dev/null
@@ -1,77 +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.osgi.bootstrap;
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.List;
-import org.ops4j.pax.swissbox.core.BundleClassLoader;
-import org.ops4j.pax.swissbox.extender.BundleObserver;
-import org.ops4j.pax.swissbox.extender.BundleURLScanner;
-import org.ops4j.pax.swissbox.extender.BundleWatcher;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.qi4j.bootstrap.internal.ServiceLoader;
-import org.qi4j.bootstrap.Qi4jRuntime;
-
-public final class Activator
- implements BundleActivator
-{
- private BundleWatcher<URL> urlBundleWatcher;
-
- public void start( BundleContext bundleContext )
- throws Exception
- {
- BundleURLScanner urlScanner =
- new BundleURLScanner( "META-INF/services", Qi4jRuntime.class.getName(), false );
- urlBundleWatcher = new BundleWatcher<URL>( bundleContext, urlScanner, new Qi4jBundleObserver() );
- urlBundleWatcher.start();
- }
-
- public void stop( BundleContext bundleContext )
- throws Exception
- {
- urlBundleWatcher.stop();
- }
-
- private static class Qi4jBundleObserver
- implements BundleObserver<URL>
- {
- private final HashMap<Bundle, ClassLoader> loaders;
-
- private Qi4jBundleObserver()
- {
- loaders = new HashMap<Bundle, ClassLoader>();
- }
-
- public void addingEntries( Bundle bundle, List<URL> entries )
- {
- BundleClassLoader classloader = new BundleClassLoader( bundle );
- ServiceLoader.addClassloader( classloader );
- loaders.put( bundle, classloader );
- }
-
- public void removingEntries( Bundle bundle, List<URL> entries )
- {
- ClassLoader classloader = loaders.get( bundle );
- ServiceLoader.removeClassloader( classloader );
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/example/osgi.bundle
----------------------------------------------------------------------
diff --git a/extensions/osgi/example/osgi.bundle b/extensions/osgi/example/osgi.bundle
deleted file mode 100644
index b4aaf84..0000000
--- a/extensions/osgi/example/osgi.bundle
+++ /dev/null
@@ -1,20 +0,0 @@
-Bundle-Activator: org.qi4j.core.test.osgi.internal.Activator
-
-Private-Package: org.qi4j.core.test.osgi.internal
-
-Ignore-Package: com_cenqua_clover
-
-Import-Package: org.osgi.framework, \
- org.qi4j.api.common, \
- org.qi4j.api.composite, \
- org.qi4j.api.entity, \
- org.qi4j.api.injection.scope, \
- org.qi4j.api.mixin, \
- org.qi4j.api.property, \
- org.qi4j.api.structure, \
- org.qi4j.bootstrap, \
- org.qi4j.entitystore.memory, \
- org.qi4j.spi.entitystore.helpers, \
- org.qi4j.spi.structure
-
-Export-Package: org.qi4j.core.test.osgi;version=${pom.version}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/example/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/osgi/example/pom.xml b/extensions/osgi/example/pom.xml
deleted file mode 100644
index 27aaf41..0000000
--- a/extensions/osgi/example/pom.xml
+++ /dev/null
@@ -1,47 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.qi4j.osgi</groupId>
- <artifactId>org.qi4j.core.osgi-test</artifactId>
- <version>0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.qi4j.core.osgi</groupId>
- <artifactId>qi4j-osgi-example</artifactId>
- <name>Qi4j Core - OSGi Example</name>
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.compendium</artifactId>
- <version>1.2.0</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.qi4j.core</groupId>
- <artifactId>org.qi4j.core.api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.qi4j.core</groupId>
- <artifactId>org.qi4j.core.bootstrap</artifactId>
- </dependency>
- <dependency>
- <groupId>org.qi4j.core</groupId>
- <artifactId>org.qi4j.core.spi</artifactId>
- </dependency>
- <dependency>
- <groupId>org.qi4j.core</groupId>
- <artifactId>org.qi4j.core.runtime</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>1.2.0</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/example/src/main/java/org/qi4j/osgi/AComposite.java
----------------------------------------------------------------------
diff --git a/extensions/osgi/example/src/main/java/org/qi4j/osgi/AComposite.java b/extensions/osgi/example/src/main/java/org/qi4j/osgi/AComposite.java
deleted file mode 100644
index 4b24a83..0000000
--- a/extensions/osgi/example/src/main/java/org/qi4j/osgi/AComposite.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.qi4j.osgi;
-
-import org.qi4j.api.property.Property;
-import org.qi4j.api.common.Optional;
-
-public interface AComposite
-{
- @Optional Property<String> property();
-
- String sayValue();
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/example/src/main/java/org/qi4j/osgi/AnEntity.java
----------------------------------------------------------------------
diff --git a/extensions/osgi/example/src/main/java/org/qi4j/osgi/AnEntity.java b/extensions/osgi/example/src/main/java/org/qi4j/osgi/AnEntity.java
deleted file mode 100644
index acc7aab..0000000
--- a/extensions/osgi/example/src/main/java/org/qi4j/osgi/AnEntity.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Copyright 2008 Edward Yakop.
-*
-* 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.osgi;
-
-import org.qi4j.api.property.Property;
-import org.qi4j.api.common.Optional;
-
-public interface AnEntity
-{
- @Optional Property<String> property();
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/example/src/main/java/org/qi4j/osgi/internal/APrivateComposite.java
----------------------------------------------------------------------
diff --git a/extensions/osgi/example/src/main/java/org/qi4j/osgi/internal/APrivateComposite.java b/extensions/osgi/example/src/main/java/org/qi4j/osgi/internal/APrivateComposite.java
deleted file mode 100644
index a394166..0000000
--- a/extensions/osgi/example/src/main/java/org/qi4j/osgi/internal/APrivateComposite.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright 2008 Edward Yakop.
-*
-* 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.osgi.internal;
-
-import org.qi4j.api.composite.Composite;
-import org.qi4j.api.mixin.Mixins;
-import org.qi4j.core.test.osgi.AComposite;
-import org.qi4j.api.injection.scope.This;
-
-@Mixins( APrivateComposite.ACompositeMixin.class )
-interface APrivateComposite extends AComposite, Composite
-{
- abstract class ACompositeMixin
- implements AComposite
- {
- @This private AComposite me;
-
- public final String sayValue()
- {
- return "Saying: " + me.property().get();
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/example/src/main/java/org/qi4j/osgi/internal/Activator.java
----------------------------------------------------------------------
diff --git a/extensions/osgi/example/src/main/java/org/qi4j/osgi/internal/Activator.java b/extensions/osgi/example/src/main/java/org/qi4j/osgi/internal/Activator.java
deleted file mode 100644
index 30add70..0000000
--- a/extensions/osgi/example/src/main/java/org/qi4j/osgi/internal/Activator.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2008 Niclas Hedhman. 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.osgi.internal;
-
-import java.util.Hashtable;
-import java.util.logging.Logger;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.qi4j.api.structure.Module;
-import org.qi4j.bootstrap.ApplicationAssembler;
-import org.qi4j.bootstrap.ApplicationAssembly;
-import org.qi4j.bootstrap.ApplicationAssemblyFactory;
-import org.qi4j.bootstrap.AssemblyException;
-import org.qi4j.bootstrap.Energy4Java;
-import org.qi4j.bootstrap.LayerAssembly;
-import org.qi4j.bootstrap.ModuleAssembly;
-import org.qi4j.entitystore.memory.MemoryEntityStoreService;
-import org.qi4j.spi.entity.helpers.UuidIdentityGeneratorService;
-import org.qi4j.spi.structure.ApplicationSPI;
-
-public final class Activator
- implements BundleActivator
-{
- private static final Logger LOGGER = Logger.getLogger( Activator.class.getName() );
-
- private static final String MODULE_NAME = "Single Module.";
- private static final String LAYER_NAME = "Single Layer.";
-
- private ApplicationSPI application;
- private ServiceRegistration moduleRegistration;
-
- public void start( BundleContext bundleContext )
- throws Exception
- {
- LOGGER.info( "Starting Bundle [" + bundleContext.getBundle().getSymbolicName() + "]" );
-
- Energy4Java boot = new Energy4Java();
- ApplicationAssembler assembler = new MyApplicationAssembler();
- application = boot.newApplication( assembler );
-
- LOGGER.info( "Activating application." );
- application.activate();
-
- Module module = application.findModule( LAYER_NAME, MODULE_NAME );
- LOGGER.info( "Find module [" + LAYER_NAME + ", " + MODULE_NAME + "] isFound [" + ( module != null ) + "]" );
-
- moduleRegistration = bundleContext.registerService( Module.class.getName(), module, new Hashtable() );
- LOGGER.info( "Module registered." );
- }
-
- public void stop( BundleContext bundleContext )
- throws Exception
- {
- moduleRegistration.unregister();
- application.passivate();
-
- moduleRegistration = null;
- application = null;
- }
-
-
- private static class MyApplicationAssembler
- implements ApplicationAssembler
- {
- public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory )
- throws AssemblyException
- {
- ApplicationAssembly applicationAssembly = applicationFactory.newApplicationAssembly();
- LayerAssembly layerAssembly = applicationAssembly.newLayerAssembly( LAYER_NAME );
- ModuleAssembly moduleAssembly = layerAssembly.newModuleAssembly( MODULE_NAME );
-
- moduleAssembly.addComposites( APrivateComposite.class );
- moduleAssembly.addEntities( AnEntityComposite.class );
- moduleAssembly.addServices( MemoryEntityStoreService.class );
- moduleAssembly.addServices( UuidIdentityGeneratorService.class );
-
- return applicationAssembly;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/example/src/main/java/org/qi4j/osgi/internal/AnEntityComposite.java
----------------------------------------------------------------------
diff --git a/extensions/osgi/example/src/main/java/org/qi4j/osgi/internal/AnEntityComposite.java b/extensions/osgi/example/src/main/java/org/qi4j/osgi/internal/AnEntityComposite.java
deleted file mode 100644
index 1b5fdf7..0000000
--- a/extensions/osgi/example/src/main/java/org/qi4j/osgi/internal/AnEntityComposite.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Copyright 2008 Edward Yakop.
-*
-* 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.osgi.internal;
-
-import org.qi4j.core.test.osgi.AnEntity;
-import org.qi4j.api.entity.EntityComposite;
-
-interface AnEntityComposite extends AnEntity, EntityComposite
-{
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/example/test.bundles
----------------------------------------------------------------------
diff --git a/extensions/osgi/example/test.bundles b/extensions/osgi/example/test.bundles
deleted file mode 100644
index 030ecbb..0000000
--- a/extensions/osgi/example/test.bundles
+++ /dev/null
@@ -1,12 +0,0 @@
-mvn:net.sourceforge.cglib/com.springsource.net.sf.cglib/2.1.3
-mvn:org.ops4j.pax.logging/pax-logging-api
-mvn:org.ops4j.pax.logging/pax-logging-service
-mvn:org.qi4j.core/qi4j-core-api@update
-mvn:org.qi4j.core/qi4j-core-spi@update
-mvn:org.qi4j.core/qi4j-core-runtime@update
-mvn:org.qi4j.core/qi4j-core-bootstrap@update
-mvn:org.qi4j.core.osgi/qi4j-osgi-example@update
-mvn:org.ops4j.pax.swissbox/pax-swissbox-extender
-mvn:org.ops4j.pax.swissbox/pax-swissbox-core
-mvn:org.ops4j.base/ops4j-base-lang
-mvn:org.ops4j.pax.swissbox/pax-swissbox-lifecycle
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/integrationTests/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/osgi/integrationTests/pom.xml b/extensions/osgi/integrationTests/pom.xml
deleted file mode 100644
index c7b0d5c..0000000
--- a/extensions/osgi/integrationTests/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.qi4j.osgi</groupId>
- <artifactId>org.qi4j.core.osgi-test</artifactId>
- <version>0-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.qi4j.core.osgi</groupId>
- <artifactId>qi4j-osgi-integrationTests</artifactId>
- <name>Qi4j Core - OSGi integration test</name>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemProperties>
- <property>
- <name>version.qi4j</name>
- <value>${pom.version}</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <dependency>
- <groupId>org.qi4j.core</groupId>
- <artifactId>org.qi4j.core.api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.qi4j.core.osgi</groupId>
- <artifactId>qi4j-osgi-example</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.logging</groupId>
- <artifactId>pax-logging-api</artifactId>
- <version>1.1.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.osgi.core</artifactId>
- <version>1.2.0</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/AbstractTest.java
----------------------------------------------------------------------
diff --git a/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/AbstractTest.java b/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/AbstractTest.java
deleted file mode 100644
index c88830c..0000000
--- a/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/AbstractTest.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* Copyright 2008 Edward Yakop.
-*
-* 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.osgi.test;
-
-import java.util.logging.Logger;
-import static org.junit.Assert.assertNotNull;
-import org.junit.runner.RunWith;
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.provision;
-import static org.ops4j.pax.exam.CoreOptions.systemProperty;
-import org.ops4j.pax.exam.Option;
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.logProfile;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.qi4j.api.structure.Module;
-
-@RunWith( JUnit4TestRunner.class )
-public abstract class AbstractTest
-{
- private final Logger LOGGER = Logger.getLogger( getClass().getName() );
-
- private static final String SYMBOLIC_NAME_QI4J_EXAMPLE = "org.qi4j.core.osgi.qi4j-osgi-example";
-
- @Configuration
- public final Option[] configure()
- {
- return options(
- logProfile(),
- // this is how you set the default log level when using pax logging (logProfile)
- systemProperty( "org.ops4j.pax.logging.DefaultServiceLog.level" ).value( "INFO" )
- );
- }
-
- @Configuration
- public final Option[] baseProvision()
- {
- String qi4jVersion = System.getProperty( "version.qi4j", "1.0" );
-
- return options( provision(
- "mvn:org.ops4j.pax.logging/pax-logging-api@2",
- "mvn:org.ops4j.pax.logging/pax-logging-service@2",
- "mvn:org.qi4j.core/qi4j-core-api/" + qi4jVersion + "@2",
- "mvn:org.qi4j.core/qi4j-core-spi/" + qi4jVersion + "@2",
- "mvn:org.ops4j.base/ops4j-base-lang@2",
- "mvn:org.ops4j.pax.swissbox/pax-swissbox-extender@2",
- "mvn:org.ops4j.pax.swissbox/pax-swissbox-core@2",
- "mvn:org.ops4j.pax.swissbox/pax-swissbox-lifecycle@2",
- "mvn:org.qi4j.core/qi4j-core-bootstrap/" + qi4jVersion + "@2",
- "mvn:org.qi4j.core/qi4j-core-runtime/" + qi4jVersion + "@3",
- "mvn:org.qi4j.core.osgi/qi4j-osgi-example/" + qi4jVersion + "@4"
- ) );
- }
-
- protected final Bundle getQi4jExampleBundle( BundleContext bundleContext )
- {
- Bundle exampleBundle = null;
- Bundle[] bundles = bundleContext.getBundles();
- for( Bundle bundle : bundles )
- {
- String symbolicName = bundle.getSymbolicName();
- if( SYMBOLIC_NAME_QI4J_EXAMPLE.equals( symbolicName ) )
- {
- exampleBundle = bundle;
- break;
- }
- }
-
- assertNotNull( exampleBundle );
- return exampleBundle;
- }
-
- protected final ServiceReference getModuleServiceRef( BundleContext bundleContext )
- {
- return bundleContext.getServiceReference( Module.class.getName() );
- }
-
- protected final void printBundleDetails( BundleContext bundleContext )
- {
- Bundle[] bundles = bundleContext.getBundles();
- for( Bundle bundle : bundles )
- {
- LOGGER.info( "Bundle [" + bundle.getSymbolicName() + "] State [" + bundle.getState() + "]" );
-
- LOGGER.info( "Exported Services: " );
- ServiceReference[] registeredServices = bundle.getRegisteredServices();
- if( registeredServices == null || registeredServices.length == 0 )
- {
- LOGGER.info( "none" );
- }
- else
- {
- for( ServiceReference registeredService : registeredServices )
- {
- LOGGER.info( registeredService.toString() );
- }
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/BundleLifecycleTest.java
----------------------------------------------------------------------
diff --git a/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/BundleLifecycleTest.java b/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/BundleLifecycleTest.java
deleted file mode 100644
index 77de18c..0000000
--- a/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/BundleLifecycleTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Copyright 2008 Edward Yakop.
- *
- * 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.osgi.test;
-
-import java.util.logging.Logger;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import org.junit.Test;
-import org.ops4j.pax.exam.Inject;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.ServiceReference;
-
-public class BundleLifecycleTest extends AbstractTest
-{
-
- @Inject
- private BundleContext bundleContext;
-
- @Test
- public final void testLifecycle()
- throws BundleException
- {
-// printBundleDetails( bundleContext );
-
- assertNotNull( getModuleServiceRef( bundleContext ) );
-
- Bundle exampleBundle = getQi4jExampleBundle( bundleContext );
- exampleBundle.stop();
-
- assertNull( getModuleServiceRef( bundleContext ) );
-
- exampleBundle.start();
-
- assertNotNull( getModuleServiceRef( bundleContext ) );
- }
-
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/BundleLifecycleWithCglibTest.java
----------------------------------------------------------------------
diff --git a/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/BundleLifecycleWithCglibTest.java b/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/BundleLifecycleWithCglibTest.java
deleted file mode 100644
index 5f92ad0..0000000
--- a/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/BundleLifecycleWithCglibTest.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.qi4j.osgi.test;
-
-import static org.ops4j.pax.exam.CoreOptions.options;
-import static org.ops4j.pax.exam.CoreOptions.provision;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-
-public final class BundleLifecycleWithCglibTest extends BundleLifecycleTest
-{
- @Configuration
- public final Option[] cglibProvision()
- {
- String cglibVersion = System.getProperty( "version.cglib", "2.2" );
- return options(
- provision( "mvn:cglib/cglib-nodep/" + cglibVersion )
- );
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/CompositeTest.java
----------------------------------------------------------------------
diff --git a/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/CompositeTest.java b/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/CompositeTest.java
deleted file mode 100644
index ea58f9d..0000000
--- a/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/CompositeTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Copyright 2008 Edward Yakop.
-*
-* 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.osgi.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import org.junit.Test;
-import org.ops4j.pax.exam.Inject;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.qi4j.api.composite.TransientBuilderFactory;
-import org.qi4j.api.property.Property;
-import org.qi4j.api.structure.Module;
-import org.qi4j.core.test.osgi.AComposite;
-
-public final class CompositeTest extends AbstractTest
-{
- @Inject
- private BundleContext bundleContext;
-
- @Test
- public final void testCreational()
- {
- ServiceReference moduleServiceRef = getModuleServiceRef( bundleContext );
- assertNotNull( moduleServiceRef );
-
- Module module = (Module) bundleContext.getService( moduleServiceRef );
- assertNotNull( module );
-
- TransientBuilderFactory factory = module.transientBuilderFactory();
- AComposite composite = factory.newTransient( AComposite.class );
- assertNotNull( composite );
-
- Property<String> property = composite.property();
- assertNotNull( property );
-
- assertNull( property.get() );
- property.set( "abc" );
- assertEquals( "abc", property.get() );
-
- // Clean up
- bundleContext.ungetService( moduleServiceRef );
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/EntityTest.java
----------------------------------------------------------------------
diff --git a/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/EntityTest.java b/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/EntityTest.java
deleted file mode 100644
index 633ab56..0000000
--- a/extensions/osgi/integrationTests/src/test/java/org/qi4j/osgi/test/EntityTest.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Copyright 2008 Edward Yakop.
-*
-* 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.osgi.test;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.fail;
-import org.junit.Test;
-import org.ops4j.pax.exam.Inject;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.qi4j.api.entity.Identity;
-import org.qi4j.api.property.Property;
-import org.qi4j.api.structure.Module;
-import org.qi4j.api.unitofwork.NoSuchEntityException;
-import org.qi4j.api.unitofwork.UnitOfWork;
-import org.qi4j.api.unitofwork.UnitOfWorkCompletionException;
-import org.qi4j.api.unitofwork.UnitOfWorkFactory;
-import org.qi4j.core.test.osgi.AnEntity;
-
-public final class EntityTest extends AbstractTest
-{
- @Inject
- private BundleContext bundleContext;
-
- private UnitOfWorkFactory getUnitOfWorkFactory( ServiceReference moduleRef )
- {
- assertNotNull( moduleRef );
-
- Module module = (Module) bundleContext.getService( moduleRef );
- assertNotNull( module );
-
- return module.unitOfWorkFactory();
- }
-
- private String createNewEntity( UnitOfWorkFactory uowf )
- throws UnitOfWorkCompletionException
- {
- UnitOfWork uow = uowf.newUnitOfWork();
- AnEntity entity = uow.newEntity( AnEntity.class );
- assertNotNull( entity );
-
- String identity = ( (Identity) entity ).identity().get();
-
- Property<String> property = entity.property();
- assertNotNull( property );
-
- assertNull( property.get() );
- property.set( "abc" );
- assertEquals( "abc", property.get() );
-
- uow.complete();
-
- return identity;
- }
-
- @Test
- public final void testCRUD()
- throws Throwable
- {
- ServiceReference moduleRef = getModuleServiceRef( bundleContext );
- UnitOfWorkFactory uowf = getUnitOfWorkFactory( moduleRef );
-
- // Test creational
- String identity = createNewEntity( uowf );
-
- // Test retrieval
- UnitOfWork work = uowf.newUnitOfWork();
- AnEntity entity = work.get(AnEntity.class, identity);
- assertNotNull( entity );
-
- // Test update
- String newPropValue = entity.property().get() + "a";
- entity.property().set( newPropValue );
- work.complete();
-
- work = uowf.newUnitOfWork();
- entity = work.get(AnEntity.class, identity);
- assertNotNull( entity );
- assertEquals( newPropValue, entity.property().get() );
- work.complete();
-
- // Test removal
- work = uowf.newUnitOfWork();
- entity = work.get(AnEntity.class, identity);
- assertNotNull( entity );
- work.remove( entity );
- work.complete();
-
- // Commented out: The odd thing is, removal fails here.
- work = uowf.newUnitOfWork();
- try
- {
- entity = work.get(AnEntity.class, identity);
- fail( "Test removal fail. [" + ( entity == null ) + "] identity [" + identity + "]" );
- }
- catch( NoSuchEntityException e )
- {
- // Expected
- }
- work.complete();
-
- // Clean up
- bundleContext.ungetService( moduleRef );
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/osgi/pom.xml b/extensions/osgi/pom.xml
deleted file mode 100644
index 27d9e83..0000000
--- a/extensions/osgi/pom.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.qi4j.sandbox</groupId>
- <artifactId>qi4j-sandbox-extensions</artifactId>
- <version>0-SNAPSHOT</version>
- </parent>
- <groupId>org.qi4j.osgi</groupId>
- <artifactId>org.qi4j.core.osgi-test</artifactId>
- <name>Qi4j OSGi (Build POM)</name>
- <packaging>pom</packaging>
-
- <properties>
- <version.pax.swissbox>1.2.0</version.pax.swissbox>
- <version.pax.exam>1.2.0</version.pax.exam>
- <version.pax.logging>1.4</version.pax.logging>
- </properties>
-
- <modules>
- <module>bootstrap</module>
- <module>testBootstrap</module>
- <module>example</module>
- <module>integrationTests</module>
- </modules>
-
- <!-- This POM is ONLY to initiate the modules to be built. -->
- <developers>
- <developer>
- <id>niclas</id>
- <name>Niclas Hedhman</name>
- <email>niclas@codedragons.com</email>
- <url>http://www.codedragons.com</url>
- <organization>CodeDragons Malaysia Sdn Bhd</organization>
- <organizationUrl>http://www.codedragons.com</organizationUrl>
- <roles>
- <role>ReleaseManager</role>
- <role>Developer</role>
- </roles>
- <timezone>UTC+8</timezone>
- </developer>
- <developer>
- <id>rickard</id>
- <name>Rickard Öberg</name>
- <email>rickard.oberg@jayway.se</email>
- <url>http://www.jayway.se</url>
- <organization>Jayway</organization>
- <organizationUrl>http://www.jayway.se</organizationUrl>
- <roles>
- <role>Innovator</role>
- <role>Developer</role>
- </roles>
- <timezone>UTC+1</timezone>
- </developer>
- <developer>
- <id>efy</id>
- <name>Edward Yakop</name>
- <email>efy@codedragons.com</email>
- <url>http://www.codedragons.com</url>
- <organization>CodeDragons Malaysia Sdn Bhd</organization>
- <organizationUrl>http://www.codedragons.com</organizationUrl>
- <roles>
- <role>Developer</role>
- </roles>
- <timezone>UTC+8</timezone>
- </developer>
- <developer>
- <id>adreghiciu</id>
- <name>Alin Dreghiciu</name>
- <email>adreghiciu@codedragons.com</email>
- <url>http://www.codedragons.com</url>
- <organization>CodeDragons Malaysia Sdn Bhd</organization>
- <organizationUrl>http://www.codedragons.com</organizationUrl>
- <roles>
- <role>Developer</role>
- </roles>
- <timezone>UTC+2</timezone>
- </developer>
- <developer>
- <id>mesirii</id>
- <name>Michael Hunger</name>
- <roles>
- <role>Developer</role>
- </roles>
- <timezone>UTC+1</timezone>
- </developer>
- </developers>
-
- <dependencies>
- <!-- Pax exam -->
- <dependency>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam</artifactId>
- <version>${version.pax.exam}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-junit</artifactId>
- <version>${version.pax.exam}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.exam</groupId>
- <artifactId>pax-exam-container-default</artifactId>
- <version>${version.pax.exam}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.ops4j.pax.swissbox</groupId>
- <artifactId>pax-swissbox-core</artifactId>
- <version>${version.pax.swissbox}</version>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
- </dependencyManagement>
-</project>
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/osgi/testBootstrap/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/osgi/testBootstrap/pom.xml b/extensions/osgi/testBootstrap/pom.xml
deleted file mode 100644
index 8624870..0000000
--- a/extensions/osgi/testBootstrap/pom.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.qi4j.osgi</groupId>
- <artifactId>org.qi4j.core.osgi-test</artifactId>
- <version>0-SNAPSHOT</version>
- </parent>
-
- <groupId>org.qi4j.core.osgi</groupId>
- <artifactId>org.qi4j.core.osgi-test-bootstrap</artifactId>
-
- <name>Qi4j Core - OSGi Bootstrap tests</name>
-
- <dependencies>
- <!-- bootstrap -->
- <dependency>
- <groupId>cglib</groupId>
- <artifactId>cglib-nodep</artifactId>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.logging</groupId>
- <artifactId>pax-logging-api</artifactId>
- <version>${version.pax.logging}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.logging</groupId>
- <artifactId>pax-logging-service</artifactId>
- <version>${version.pax.logging}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ops4j.base</groupId>
- <artifactId>ops4j-base-lang</artifactId>
- <version>1.2.1</version>
- </dependency>
-
- <dependency>
- <groupId>org.ops4j.pax.swissbox</groupId>
- <artifactId>pax-swissbox-core</artifactId>
- <version>${version.pax.swissbox}</version>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.swissbox</groupId>
- <artifactId>pax-swissbox-extender</artifactId>
- <version>${version.pax.swissbox}</version>
- </dependency>
- <dependency>
- <groupId>org.ops4j.pax.swissbox</groupId>
- <artifactId>pax-swissbox-lifecycle</artifactId>
- <version>${version.pax.swissbox}</version>
- </dependency>
- </dependencies>
-</project>
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/extensions/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 1abe46f..7093373 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -18,20 +18,8 @@
<module>entitystore-s3</module>
<module>entitystore-swift</module>
- <!-- Used coherence version not in any public repository.
- Unable to make it compile against coherence-incubator.
+ <!-- Coherence needs a manual installation
<module>entitystore-coherence</module> -->
- <!-- See libraries/jini in sandbox
- <module>entitystore-javaspaces</module> -->
-
- <!-- Unable to make it compile.
- Plus `library/osgi` is already part of the SDK since 2.0.
- <module>osgi</module> -->
-
- <!-- There are two implementations.
- See the `gigaspaces_impl` branch of this repository
- <module>entitstore-gigaspaces/qi4j-entitystore-gs-sample</module> -->
-
</modules>
</project>
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/libraries/jini/common/dev-status.xml
----------------------------------------------------------------------
diff --git a/libraries/jini/common/dev-status.xml b/libraries/jini/common/dev-status.xml
deleted file mode 100644
index dc92d29..0000000
--- a/libraries/jini/common/dev-status.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<module xmlns="http://www.qi4j.org/schemas/2008/dev-status/1">
- <status>
- <codebase>early</codebase>
- <!--none,early,beta,stable,mature-->
- <documentation>brief</documentation>
- <!-- none, brief, good, complete -->
- <unittests>some</unittests>
- <!-- none, some, good, complete -->
- </status>
- <licenses>
- <license>ALv2</license>
- </licenses>
-</module>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-sandbox/blob/25dbfc23/libraries/jini/common/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/jini/common/pom.xml b/libraries/jini/common/pom.xml
deleted file mode 100644
index 24e23a3..0000000
--- a/libraries/jini/common/pom.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.qi4j.library.jini</groupId>
- <artifactId>org.qi4j.library.jini</artifactId>
- <version>0-SNAPSHOT</version>
- </parent>
- <groupId>org.qi4j.library.jini</groupId>
- <artifactId>org.qi4j.library.jini-common</artifactId>
-</project>