Codota Logo
PagingManagerImpl.start
Code IndexAdd Codota to your IDE (free)

How to use
start
method
in
org.apache.activemq.artemis.core.paging.impl.PagingManagerImpl

Best Java code snippets using org.apache.activemq.artemis.core.paging.impl.PagingManagerImpl.start (Showing top 2 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: apache/activemq-artemis

@Test
public void testMoveOverPaging() throws Exception {
 AssertionLoggerHandler.startCapture();
 ExecutorService threadPool = Executors.newCachedThreadPool();
 try {
   manager.setMaxFolders(3);
   for (int i = 1; i <= 10; i++) {
    HierarchicalRepository<AddressSettings> addressSettings = new HierarchicalObjectRepository<>();
    AddressSettings settings = new AddressSettings();
    settings.setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE);
    addressSettings.setDefault(settings);
    final StorageManager storageManager = new NullStorageManager();
    PagingStoreFactoryNIO storeFactory = new PagingStoreFactoryNIO(storageManager, dataLocation, 100, null, new OrderedExecutorFactory(threadPool), true, null);
    PagingManagerImpl managerImpl = new PagingManagerImpl(storeFactory, addressSettings, -1, ActiveMQDefaultConfiguration.getDefaultManagementAddress());
    managerImpl.start();
    PagingStore store = managerImpl.getPageStore(new SimpleString("simple-test"));
    store.startPaging();
    store.stop();
    managerImpl.stop();
    manager.doMove();
    Assert.assertEquals(Math.min(i, manager.getMaxFolders()), manager.getNumberOfFolders());
   }
   Assert.assertFalse("The loggers are complaining about address.txt", AssertionLoggerHandler.findText("address.txt"));
 } finally {
   AssertionLoggerHandler.stopCapture();
   threadPool.shutdown();
 }
}
origin: apache/activemq-artemis

@Test
public void testPagingManager() throws Exception {
 HierarchicalRepository<AddressSettings> addressSettings = new HierarchicalObjectRepository<>();
 addressSettings.setDefault(new AddressSettings().setAddressFullMessagePolicy(AddressFullMessagePolicy.PAGE));
 final StorageManager storageManager = new NullStorageManager();
 PagingStoreFactoryNIO storeFactory = new PagingStoreFactoryNIO(storageManager, getPageDirFile(), 100, null, getOrderedExecutor(), true, null);
 PagingManagerImpl managerImpl = new PagingManagerImpl(storeFactory, addressSettings);
 managerImpl.start();
 PagingStore store = managerImpl.getPageStore(new SimpleString("simple-test"));
 ICoreMessage msg = createMessage(1L, new SimpleString("simple-test"), createRandomBuffer(10));
 final RoutingContextImpl ctx = new RoutingContextImpl(null);
 Assert.assertFalse(store.page(msg, ctx.getTransaction(), ctx.getContextListing(store.getStoreName()), lock));
 store.startPaging();
 Assert.assertTrue(store.page(msg, ctx.getTransaction(), ctx.getContextListing(store.getStoreName()), lock));
 Page page = store.depage();
 page.open();
 List<PagedMessage> msgs = page.read(new NullStorageManager());
 page.close();
 Assert.assertEquals(1, msgs.size());
 ActiveMQTestBase.assertEqualsByteArrays(msg.getBodyBuffer().writerIndex(), msg.getBodyBuffer().toByteBuffer().array(), (msgs.get(0).getMessage()).toCore().getBodyBuffer().toByteBuffer().array());
 Assert.assertTrue(store.isPaging());
 Assert.assertNull(store.depage());
 final RoutingContextImpl ctx2 = new RoutingContextImpl(null);
 Assert.assertFalse(store.page(msg, ctx2.getTransaction(), ctx2.getContextListing(store.getStoreName()), lock));
}
org.apache.activemq.artemis.core.paging.implPagingManagerImplstart

Popular methods of PagingManagerImpl

  • <init>
  • getPageStore
    This method creates a new store if not exist.
  • checkMemoryRelease
  • debug
  • isGlobalFull
  • lock
  • memoryReleased
  • newStore
  • reapplySettings
  • reloadStores
  • stop
  • unlock
  • stop,
  • unlock

Popular in Java

  • Reading from database using SQL prepared statement
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • String (java.lang)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now