Search in sources :

Example 1 with UDPBroadcaster

use of org.apache.jackrabbit.oak.plugins.document.persistentCache.broadcast.UDPBroadcaster in project jackrabbit-oak by apache.

the class PersistentCache method initBroadcast.

private void initBroadcast(String broadcast) {
    if (broadcast == null) {
        return;
    }
    if (broadcast.equals("disabled")) {
        return;
    } else if (broadcast.equals("inMemory")) {
        broadcaster = InMemoryBroadcaster.INSTANCE;
    } else if (broadcast.startsWith("udp:")) {
        String config = broadcast.substring("udp:".length(), broadcast.length());
        broadcaster = new UDPBroadcaster(config);
    } else if (broadcast.startsWith("tcp:")) {
        String config = broadcast.substring("tcp:".length(), broadcast.length());
        broadcaster = new TCPBroadcaster(config);
    } else {
        throw new IllegalArgumentException("Unknown broadcaster type " + broadcast);
    }
    broadcaster.addListener(this);
}
Also used : UDPBroadcaster(org.apache.jackrabbit.oak.plugins.document.persistentCache.broadcast.UDPBroadcaster) TCPBroadcaster(org.apache.jackrabbit.oak.plugins.document.persistentCache.broadcast.TCPBroadcaster)

Aggregations

TCPBroadcaster (org.apache.jackrabbit.oak.plugins.document.persistentCache.broadcast.TCPBroadcaster)1 UDPBroadcaster (org.apache.jackrabbit.oak.plugins.document.persistentCache.broadcast.UDPBroadcaster)1