Author: simonetripodi
Date: Fri Feb 24 15:24:08 2012
New Revision: 1293291
URL: http://svn.apache.org/viewvc?rev=1293291&view=rev
Log:
[DIRECTMEMORY-62] Adopt fluent APIs for bootstrapping the Cache
added Interfaces and basic abstract implementations of configurator stuff
it will be the foundation of all configuration/boostraps (sorl, server, etc)
still in progress
Added:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/AbstractCacheConfiguration.java
(with props)
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguration.java
(with props)
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfigurator.java
(with props)
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguratorImpl.java
(with props)
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemory.java
(with props)
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemoryLoaderException.java
(with props)
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/ErrorMessage.java
(with props)
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/MemoryUnitDimensionBuilder.java
(with props)
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/SizeBuilder.java
(with props)
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/TimeMeasureBuilder.java
(with props)
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/package-info.java
(with props)
Added:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/AbstractCacheConfiguration.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/AbstractCacheConfiguration.java?rev=1293291&view=auto
==============================================================================
---
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/AbstractCacheConfiguration.java
(added)
+++
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/AbstractCacheConfiguration.java
Fri Feb 24 15:24:08 2012
@@ -0,0 +1,68 @@
+package org.apache.directmemory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+public abstract class AbstractCacheConfiguration<K, V>
+ implements CacheConfiguration<K, V>
+{
+
+ private CacheConfigurator<K, V> cacheConfigurator;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public final void configure( CacheConfigurator<K, V> cacheConfigurator )
+ {
+ if ( this.cacheConfigurator != null )
+ {
+ throw new IllegalStateException( "Re-entry is not allowed!" );
+ }
+
+ this.cacheConfigurator = cacheConfigurator;
+
+ try
+ {
+ configure();
+ }
+ finally
+ {
+ this.cacheConfigurator = null;
+ }
+ }
+
+ protected abstract void configure();
+
+ protected final MemoryUnitDimensionBuilder allocateMemoryOfSize( double
size )
+ {
+ return cacheConfigurator.allocateMemoryOfSize( size );
+ }
+
+ protected final SizeBuilder numberOfBuffers()
+ {
+ return cacheConfigurator.numberOfBuffers();
+ }
+
+ protected final TimeMeasureBuilder scheduleDisposalEvery( long time )
+ {
+ return cacheConfigurator.scheduleDisposalEvery( time );
+ }
+
+}
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/AbstractCacheConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/AbstractCacheConfiguration.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/AbstractCacheConfiguration.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguration.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguration.java?rev=1293291&view=auto
==============================================================================
---
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguration.java
(added)
+++
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguration.java
Fri Feb 24 15:24:08 2012
@@ -0,0 +1,27 @@
+package org.apache.directmemory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+public interface CacheConfiguration<K, V>
+{
+
+ void configure( CacheConfigurator<K, V> cacheConfigurator );
+
+}
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguration.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguration.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguration.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfigurator.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfigurator.java?rev=1293291&view=auto
==============================================================================
---
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfigurator.java
(added)
+++
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfigurator.java
Fri Feb 24 15:24:08 2012
@@ -0,0 +1,31 @@
+package org.apache.directmemory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+public interface CacheConfigurator<K, V>
+{
+
+ MemoryUnitDimensionBuilder allocateMemoryOfSize( double size );
+
+ SizeBuilder numberOfBuffers();
+
+ TimeMeasureBuilder scheduleDisposalEvery( long time );
+
+}
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfigurator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfigurator.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfigurator.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguratorImpl.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguratorImpl.java?rev=1293291&view=auto
==============================================================================
---
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguratorImpl.java
(added)
+++
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguratorImpl.java
Fri Feb 24 15:24:08 2012
@@ -0,0 +1,127 @@
+package org.apache.directmemory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Formatter;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.ConcurrentMap;
+
+import org.apache.directmemory.cache.CacheService;
+import org.apache.directmemory.memory.MemoryManagerService;
+import org.apache.directmemory.memory.Pointer;
+import org.apache.directmemory.serialization.Serializer;
+
+final class CacheConfiguratorImpl<K, V>
+ implements CacheConfigurator<K, V>
+{
+
+ /**
+ * The default head when reporting an errors list.
+ */
+ private static final String HEADING = "Apache DirectMemory creation
errors:%n%n";
+
+ private static int DEFAULT_INITIAL_CAPACITY = 100000;
+
+ private static int DEFAULT_CONCURRENCY_LEVEL = 4;
+
+ private final List<ErrorMessage> errors = new LinkedList<ErrorMessage>();
+
+ private int numberOfBuffers;
+
+ private int size;
+
+ private MemoryManagerService<V> memoryManager;
+
+ private ConcurrentMap<String, Pointer<V>> map;
+
+ private Serializer serializer;
+
+ @Override
+ public MemoryUnitDimensionBuilder allocateMemoryOfSize( double size )
+ {
+ checkState( size > 0, "Input value %s is not a valid value to express
a memory space", size );
+ return null;
+ }
+
+ @Override
+ public SizeBuilder numberOfBuffers()
+ {
+ // TODO
+ return null;
+ }
+
+ @Override
+ public TimeMeasureBuilder scheduleDisposalEvery( long time )
+ {
+ checkState( time > 0, "Input value %s is not a valid value to express
a time measure", time );
+ // TODO
+ return null;
+ }
+
+ private void checkState( boolean expression, String errorMessageTemplate,
Object... errorMessageArgs )
+ {
+ if ( !expression )
+ {
+ errors.add( new ErrorMessage( errorMessageTemplate,
errorMessageArgs ) );
+ }
+ }
+
+ public CacheService<K, V> createInstance()
+ {
+ if ( !errors.isEmpty() )
+ {
+ Formatter fmt = new Formatter().format( HEADING );
+ int index = 1;
+
+ for ( ErrorMessage errorMessage : errors )
+ {
+ fmt.format( "%s) %s%n", index++, errorMessage.getMessage() );
+
+ Throwable cause = errorMessage.getCause();
+ if ( cause != null )
+ {
+ StringWriter writer = new StringWriter();
+ cause.printStackTrace( new PrintWriter( writer ) );
+ fmt.format( "Caused by: %s", writer.getBuffer() );
+ }
+
+ fmt.format( "%n" );
+ }
+
+ if ( errors.size() == 1 )
+ {
+ fmt.format( "1 error" );
+ }
+ else
+ {
+ fmt.format( "%s errors", errors.size() );
+ }
+
+ throw new DirectMemoryLoaderException( fmt.toString() );
+ }
+
+ // TODO needs to be completed
+ return null;
+ }
+
+}
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguratorImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguratorImpl.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/CacheConfiguratorImpl.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemory.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemory.java?rev=1293291&view=auto
==============================================================================
---
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemory.java
(added)
+++
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemory.java
Fri Feb 24 15:24:08 2012
@@ -0,0 +1,46 @@
+package org.apache.directmemory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+import static org.apache.directmemory.utils.Assertions.checkArgument;
+
+import org.apache.directmemory.cache.CacheService;
+
+public final class DirectMemory
+{
+
+ public static <K, V> CacheService<K, V> createNewInstance(
CacheConfiguration<K, V> cacheConfiguration )
+ {
+ checkArgument( cacheConfiguration != null, "Impossible to create a
cache from a null configuration" );
+
+ CacheConfiguratorImpl<K, V> cacheConfigurator = new
CacheConfiguratorImpl<K, V>();
+ cacheConfiguration.configure( cacheConfigurator );
+ return cacheConfigurator.createInstance();
+ }
+
+ /**
+ * This class cannot be instantiated.
+ */
+ private DirectMemory()
+ {
+ // does nothing
+ }
+
+}
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemory.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemory.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemoryLoaderException.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemoryLoaderException.java?rev=1293291&view=auto
==============================================================================
---
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemoryLoaderException.java
(added)
+++
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemoryLoaderException.java
Fri Feb 24 15:24:08 2012
@@ -0,0 +1,36 @@
+package org.apache.directmemory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+public final class DirectMemoryLoaderException
+ extends RuntimeException
+{
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6380187128592445990L;
+
+ public DirectMemoryLoaderException( String message )
+ {
+ super( message );
+ }
+
+}
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemoryLoaderException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemoryLoaderException.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/DirectMemoryLoaderException.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/ErrorMessage.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/ErrorMessage.java?rev=1293291&view=auto
==============================================================================
---
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/ErrorMessage.java
(added)
+++
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/ErrorMessage.java
Fri Feb 24 15:24:08 2012
@@ -0,0 +1,94 @@
+package org.apache.directmemory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+import static java.lang.String.format;
+
+/**
+ * An error message and the context in which it occurred.
+ *
+ * Messages are usually created internally by {@code DirectMemory}.
+ */
+final class ErrorMessage
+{
+
+ /**
+ * The error message text.
+ */
+ private final String message;
+
+ /**
+ * The throwable that caused this message.
+ */
+ /* @Nullable */private final Throwable cause;
+
+ /**
+ * Create a new {@link ErrorMessage} instance from the error message text.
+ *
+ * @param messagePattern The error message text pattern
+ * @param arguments Arguments referenced by the format specifiers in the
format string
+ */
+ public ErrorMessage( String messagePattern, Object... arguments )
+ {
+ this( format( messagePattern, arguments ), (Throwable) null );
+ }
+
+ /**
+ * Create a new {@link ErrorMessage} instance from the error message text
and the related cause.
+ *
+ * @param message The error message text
+ * @param cause The throwable that caused this message
+ */
+ public ErrorMessage( String message, Throwable cause )
+ {
+ this.message = message;
+ this.cause = cause;
+ }
+
+ /**
+ * Gets the error message text.
+ *
+ * @return The error message text
+ */
+ public String getMessage()
+ {
+ return message;
+ }
+
+ /**
+ * Returns the Throwable that caused this message, or {@code null} if this
message was not caused by a Throwable.
+ *
+ * @return The Throwable that caused this message, or {@code null} if this
message was not caused by a Throwable
+ */
+ public Throwable getCause()
+ {
+ return cause;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString()
+ {
+ return message;
+ }
+
+}
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/ErrorMessage.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/ErrorMessage.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/ErrorMessage.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/MemoryUnitDimensionBuilder.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/MemoryUnitDimensionBuilder.java?rev=1293291&view=auto
==============================================================================
---
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/MemoryUnitDimensionBuilder.java
(added)
+++
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/MemoryUnitDimensionBuilder.java
Fri Feb 24 15:24:08 2012
@@ -0,0 +1,31 @@
+package org.apache.directmemory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+public interface MemoryUnitDimensionBuilder
+{
+
+ void Gb();
+
+ void Mb();
+
+ void Kb();
+
+}
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/MemoryUnitDimensionBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/MemoryUnitDimensionBuilder.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/MemoryUnitDimensionBuilder.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/SizeBuilder.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/SizeBuilder.java?rev=1293291&view=auto
==============================================================================
---
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/SizeBuilder.java
(added)
+++
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/SizeBuilder.java
Fri Feb 24 15:24:08 2012
@@ -0,0 +1,27 @@
+package org.apache.directmemory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+public interface SizeBuilder
+{
+
+ void ofSize( int size );
+
+}
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/SizeBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/SizeBuilder.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/SizeBuilder.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/TimeMeasureBuilder.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/TimeMeasureBuilder.java?rev=1293291&view=auto
==============================================================================
---
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/TimeMeasureBuilder.java
(added)
+++
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/TimeMeasureBuilder.java
Fri Feb 24 15:24:08 2012
@@ -0,0 +1,33 @@
+package org.apache.directmemory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+public interface TimeMeasureBuilder
+{
+
+ void seconds();
+
+ void minutes();
+
+ void hours();
+
+ void days();
+
+}
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/TimeMeasureBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/TimeMeasureBuilder.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/TimeMeasureBuilder.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/package-info.java
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/package-info.java?rev=1293291&view=auto
==============================================================================
---
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/package-info.java
(added)
+++
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/package-info.java
Fri Feb 24 15:24:08 2012
@@ -0,0 +1,23 @@
+/**
+ * Apache DirectMemory is a multi layered cache implementation featuring
off-heap memory management.
+ */
+package org.apache.directmemory;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/package-info.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/package-info.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/package-info.java
------------------------------------------------------------------------------
svn:mime-type = text/plain