Skip to content

Commit

Permalink
Issue #49: Resolved inappropriate use of CacheFactory.ensureCluster()…
Browse files Browse the repository at this point in the history
…, replacing with CacheFactory.getCluster()

Issue #159: Introduced ability to provide a ConfigurableCacheFactory when creating a ProcessingSession
Issue #160: Ensure consistent use of ClassLoaders based on calling context
Issue #161: Ensure Processing Pattern is initialized using the Cache Configuration LifecycleEvents
Issue #162: Introduce Shared ExecutorService for internal background tasks
Issue #163: Resolves fail-over/fail-back of Grid-based Tasks
  • Loading branch information
Brian Oliver committed Feb 21, 2017
2 parents 3e631be + 5466f7b commit 50cfe64
Show file tree
Hide file tree
Showing 24 changed files with 654 additions and 343 deletions.
35 changes: 35 additions & 0 deletions coherence-incubator-site/src/site/markdown/history.md.vm
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,48 @@ reverse chronological order.

* Brian Oliver

<h4>coherence-processingpattern</h4>

* [Issue #49](https://github.com/coherence-community/coherence-incubator/issues/49):
Resolved inappropriate use of CacheFactory.ensureCluster(), replacing with CacheFactory.getCluster().

* [Issue #159](https://github.com/coherence-community/coherence-incubator/issues/159):
Introduced ability to provide a ConfigurableCacheFactory when creating a ProcessingSession.

* [Issue #160](https://github.com/coherence-community/coherence-incubator/issues/160):
Ensure consistent use of ClassLoaders based on calling context.

* [Issue #161](https://github.com/coherence-community/coherence-incubator/issues/161):
Ensure Processing Pattern is initialized using the Cache Configuration LifecycleEvents.

* [Issue #162](https://github.com/coherence-community/coherence-incubator/issues/162):
Introduce Shared ExecutorService for internal background tasks.

* [Issue #163](https://github.com/coherence-community/coherence-incubator/issues/163):
Resolves fail-over/fail-back of Grid-based Tasks.


--------------------------------------------------------------------------------

<h3>Version: 12.4.0 built on 2017-09-28</h3>

<h4>Source and Documentation Contributors</h4>

* Brian Oliver

<h4>Global and Cross-Module Changes</h4>

* [Issue #152](https://github.com/coherence-community/coherence-incubator/issues/152): Upgraded to require
Coherence 12.2.1 Java 8.

<h4>coherence-eventdistributionpattern</h4>

* [Issue #156](https://github.com/coherence-community/coherence-incubator/issues/156): Event Channels may
transition to "paused" state when encountering an Entry without meta-data, which may be caused by attempting
to remove a non-existent entry. Such requests will log a warning and will be ignored.

<h4>coherence-eventdistributionpattern</h4>

* [Issue #156](https://github.com/coherence-community/coherence-incubator/issues/156): Event Channels may
transition to "paused" state when encountering an Entry without meta-data, which may be caused by attempting
to remove a non-existent entry. Such requests will log a warning and will be ignored.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* File: QueueTests.java
* File: MessagingTests.java
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* The contents of this file are subject to the terms and conditions of
* The contents of this file are subject to the terms and conditions of
* the Common Development and Distribution License 1.0 (the "License").
*
* You may not use this file except in compliance with the License.
Expand All @@ -25,16 +25,16 @@

package com.oracle.coherence.patterns.messaging.test;

import com.oracle.bedrock.junit.CoherenceClusterOrchestration;
import com.oracle.bedrock.junit.CoherenceClusterResource;
import com.oracle.bedrock.junit.SessionBuilders;
import com.oracle.bedrock.options.Diagnostics;
import com.oracle.bedrock.runtime.LocalPlatform;
import com.oracle.bedrock.runtime.coherence.CoherenceCluster;
import com.oracle.bedrock.runtime.coherence.options.CacheConfig;
import com.oracle.bedrock.runtime.coherence.options.LocalStorage;
import com.oracle.bedrock.runtime.coherence.options.Pof;
import com.oracle.bedrock.runtime.java.options.IPv4Preferred;
import com.oracle.bedrock.runtime.java.options.SystemProperty;
import com.oracle.bedrock.runtime.options.Console;
import com.oracle.bedrock.runtime.options.DisplayName;
import com.oracle.coherence.common.identifiers.Identifier;
import com.oracle.coherence.patterns.messaging.DefaultMessagingSession;
import com.oracle.coherence.patterns.messaging.MessagingSession;
Expand Down Expand Up @@ -65,20 +65,18 @@
public class MessagingTests
{
/**
* Establish a {@link CoherenceClusterOrchestration} to orchestrate a {@link CoherenceCluster}.
* Establish a {@link CoherenceClusterResource} to orchestrate a {@link CoherenceCluster}.
*/
@ClassRule
public static CoherenceClusterOrchestration orchestration =
new CoherenceClusterOrchestration().withOptions(CacheConfig.of("coherence-messagingpattern-cache-config.xml"),
Diagnostics.enabled(),
Console.system(),
IPv4Preferred.yes(),
Pof.config("coherence-messagingpattern-test-pof-config.xml"),
Pof.enabled())
.withProxyMemberOptions(CacheConfig.of("coherence-messagingpattern-test-cache-config.xml"),
SystemProperty.of("proxy.port",
LocalPlatform.get()
.getAvailablePorts()));
public static CoherenceClusterResource clusterResource =
new CoherenceClusterResource().with(CacheConfig.of("coherence-messagingpattern-cache-config.xml"),
Diagnostics.enabled(),
Console.system(),
IPv4Preferred.yes(),
Pof.config("coherence-messagingpattern-test-pof-config.xml"),
Pof.enabled()).include(2,
LocalStorage.enabled(),
DisplayName.of("storage"));

/**
* The {@link ConfigurableCacheFactory} for the tests.
Expand All @@ -92,10 +90,10 @@ public class MessagingTests


@Before
public void setup()
public void setup()
{
// establish the CCF to interact with Coherence
factory = orchestration.getSessionFor(SessionBuilders.storageDisabledMember());
factory = clusterResource.createSession(SessionBuilders.storageDisabledMember());

// create a shared MessagingSession for the tests
messagingSession = DefaultMessagingSession.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,19 @@
import com.tangosol.net.CacheFactory;

import java.io.IOException;
import java.util.Random;

/**
* A simple restartable task.
* A simple restartable task that delays a random amount of time between 0 and 1 seconds.
* <p>
* Copyright (c) 2009. All Rights Reserved. Oracle Corporation.<br>
* Copyright (c) 2017. All Rights Reserved. Oracle Corporation.<br>
* Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
*
* @author Christer Fahlgren
* @author Brian Oliver
*/
public class RestartTask implements ResumableTask, PortableObject
{
private String sName;
private String name;


/**
Expand All @@ -58,56 +59,53 @@ public RestartTask()
/**
* Constructs a {@link RestartTask}.
*
* @param sName
* @param name the name of the task (that is returned)
*/
public RestartTask(String sName)
public RestartTask(String name)
{
this.sName = sName;
this.name = name;
}


/**
* {@inheritDoc}
*/
@Override
public String toString()
{
return "RestartTask [" + (sName != null ? "sName=" + sName : "") + "]";
return "RestartTask [" + (name != null ? "sName=" + name : "") + "]";
}


/**
* Method description
*
* @param oEnvironment
*
* @return
*/
@Override
public Object run(TaskExecutionEnvironment oEnvironment)
{
CacheFactory.log(sName + " processed...", CacheFactory.LOG_ALWAYS);

return sName;
CacheFactory.log(name + " processing...", CacheFactory.LOG_ALWAYS);

Random random = new Random();

try
{
Thread.sleep(random.nextInt(1000));
}
catch (InterruptedException e)
{
CacheFactory.log(name + " interrupted!");
}

CacheFactory.log(name + " processed...", CacheFactory.LOG_ALWAYS);

return name;
}


/**
* {@inheritDoc}
*/
@Override
public void readExternal(PofReader reader) throws IOException
{
this.sName = reader.readString(0);
this.name = reader.readString(0);
}


/**
* {@inheritDoc}
*/
@Override
public void writeExternal(PofWriter writer) throws IOException
{
writer.writeString(0, sName);
writer.writeString(0, name);
}
}
Loading

0 comments on commit 50cfe64

Please sign in to comment.