Moved pipeline RMI files into rmi package
This commit is contained in:
parent
ed1fdf4085
commit
c2d6f66030
@ -21,8 +21,8 @@ import dorkbox.network.connection.Connection;
|
|||||||
import dorkbox.network.connection.RegistrationWrapper;
|
import dorkbox.network.connection.RegistrationWrapper;
|
||||||
import dorkbox.network.connection.registration.MetaChannel;
|
import dorkbox.network.connection.registration.MetaChannel;
|
||||||
import dorkbox.network.connection.registration.RegistrationHandler;
|
import dorkbox.network.connection.registration.RegistrationHandler;
|
||||||
import dorkbox.network.pipeline.LocalRmiDecoder;
|
import dorkbox.network.pipeline.rmi.LocalRmiDecoder;
|
||||||
import dorkbox.network.pipeline.LocalRmiEncoder;
|
import dorkbox.network.pipeline.rmi.LocalRmiEncoder;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
|
|
||||||
|
@ -13,11 +13,18 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package dorkbox.network.pipeline;
|
package dorkbox.network.pipeline.rmi;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is for a LOCAL connection (same-JVM)
|
||||||
|
*/
|
||||||
class LocalRmiClassEncoder {
|
class LocalRmiClassEncoder {
|
||||||
public Object rmiObject;
|
public Object rmiObject;
|
||||||
|
|
||||||
// these are the "in order" rmi ID's for the fields of 'rmiObject'
|
// these are the "in order" rmi ID's for the fields of 'rmiObject'
|
||||||
public int[] rmiFieldIds;
|
public int[] rmiFieldIds;
|
||||||
|
|
||||||
|
public
|
||||||
|
LocalRmiClassEncoder() {
|
||||||
|
}
|
||||||
}
|
}
|
@ -13,16 +13,20 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package dorkbox.network.pipeline;
|
package dorkbox.network.pipeline.rmi;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import dorkbox.network.connection.ConnectionImpl;
|
import dorkbox.network.connection.ConnectionImpl;
|
||||||
import dorkbox.network.rmi.RemoteObject;
|
import dorkbox.network.rmi.RemoteObject;
|
||||||
|
import dorkbox.network.serialization.CryptoSerializationManager;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.handler.codec.MessageToMessageDecoder;
|
import io.netty.handler.codec.MessageToMessageDecoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is for a LOCAL connection (same-JVM)
|
||||||
|
*/
|
||||||
public
|
public
|
||||||
class LocalRmiDecoder extends MessageToMessageDecoder<Object> {
|
class LocalRmiDecoder extends MessageToMessageDecoder<Object> {
|
||||||
|
|
||||||
@ -69,9 +73,11 @@ class LocalRmiDecoder extends MessageToMessageDecoder<Object> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
final Class<?> iface = connection.getEndPoint()
|
CryptoSerializationManager serialization = connection.getEndPoint()
|
||||||
.getSerialization()
|
.getSerialization();
|
||||||
.getRmiIface(localRmiObject.getClass());
|
|
||||||
|
// TODO: see what's up with this.
|
||||||
|
final Class<?> iface = serialization.getRmiIface(localRmiObject.getClass());
|
||||||
if (iface == null) {
|
if (iface == null) {
|
||||||
throw new RuntimeException("Unable to get interface for RMI implementation");
|
throw new RuntimeException("Unable to get interface for RMI implementation");
|
||||||
}
|
}
|
@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package dorkbox.network.pipeline;
|
package dorkbox.network.pipeline.rmi;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -29,6 +29,9 @@ import io.netty.channel.ChannelHandler.Sharable;
|
|||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.handler.codec.MessageToMessageEncoder;
|
import io.netty.handler.codec.MessageToMessageEncoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is for a LOCAL connection (same-JVM)
|
||||||
|
*/
|
||||||
@Sharable
|
@Sharable
|
||||||
public
|
public
|
||||||
class LocalRmiEncoder extends MessageToMessageEncoder<Object> {
|
class LocalRmiEncoder extends MessageToMessageEncoder<Object> {
|
@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package dorkbox.network.pipeline;
|
package dorkbox.network.pipeline.rmi;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -25,6 +25,9 @@ import dorkbox.network.rmi.Rmi;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Uses the "single writer principle" for fast access, but disregards 'single writer', because duplicates are OK
|
* Uses the "single writer principle" for fast access, but disregards 'single writer', because duplicates are OK
|
||||||
|
*
|
||||||
|
* This is for a LOCAL connection (same-JVM)
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
class RmiFieldCache {
|
class RmiFieldCache {
|
||||||
private volatile IdentityMap<Class<?>, Field[]> fieldCache = new IdentityMap<Class<?>, Field[]>();
|
private volatile IdentityMap<Class<?>, Field[]> fieldCache = new IdentityMap<Class<?>, Field[]>();
|
Loading…
Reference in New Issue
Block a user