[
https://issues.apache.org/jira/browse/GOSSIP-79?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15973948#comment-15973948
]
ASF GitHub Bot commented on GOSSIP-79:
--------------------------------------
Github user edwardcapriolo commented on a diff in the pull request:
https://github.com/apache/incubator-gossip/pull/47#discussion_r112104257
--- Diff:
gossip-base/src/main/java/org/apache/gossip/transport/AbstractTransportManager.java
---
@@ -0,0 +1,86 @@
+/*
+ * 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.
+ */
+package org.apache.gossip.transport;
+
+import com.codahale.metrics.MetricRegistry;
+import org.apache.gossip.manager.AbstractActiveGossiper;
+import org.apache.gossip.manager.GossipCore;
+import org.apache.gossip.manager.GossipManager;
+import org.apache.gossip.manager.PassiveGossipThread;
+import org.apache.gossip.utils.ReflectionUtils;
+import org.apache.log4j.Logger;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Manage the protcol threads (active and passive gossipers).
+ */
+public abstract class AbstractTransportManager implements TransportManager
{
+
+ public static final Logger LOGGER =
Logger.getLogger(AbstractTransportManager.class);
+
+ private final PassiveGossipThread passiveGossipThread;
+ private final ExecutorService gossipThreadExecutor;
+
+ private final AbstractActiveGossiper activeGossipThread;
+
+ public AbstractTransportManager(GossipManager gossipManager, GossipCore
gossipCore) {
+
+ passiveGossipThread = new PassiveGossipThread(gossipManager,
gossipCore);
+ gossipThreadExecutor = Executors.newCachedThreadPool();
+ activeGossipThread = ReflectionUtils.constructWithReflection(
+ gossipManager.getSettings().getActiveGossipClass(),
+ new Class<?>[]{
+ GossipManager.class, GossipCore.class, MetricRegistry.class
+ },
+ new Object[]{
+ gossipManager, gossipCore, gossipManager.getRegistry()
+ });
+ }
+
+ // shut down threads etc.
+ @Override
+ public void terminate() {
--- End diff --
I have been using the names init() shutdown() is there a reason to call
this one termite
> create gossip-transport-udp module
> ----------------------------------
>
> Key: GOSSIP-79
> URL: https://issues.apache.org/jira/browse/GOSSIP-79
> Project: Gossip
> Issue Type: Improvement
> Reporter: Gary Dusbabek
> Assignee: Gary Dusbabek
>
> Create a transport module that houses the UDP transport.
> This will probably require some refactoring. It may be prudent to create a
> few interfaces that are kept in gossip-core which are then implemented in
> gossip-transport-udp.
> This probably needs to be a modules
> 1 udp-server
> 2 udp-client
> OtherThings:
> GossipManager.build() needs to look at the URI and dynamically load the right
> server
> GossipCore.send() needs to locate the right client for a URI.
> Both of these things probably need a registry. Please dont make it a static
> singleton thing ! :)
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)