![JAR search and dependency download from the Maven repository](/logo.png)
com.viaoa.remote.info.BindInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of oa-core Show documentation
Show all versions of oa-core Show documentation
Object Automation library
The newest version!
/* Copyright 1999 Vince Via [email protected]
Licensed 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 com.viaoa.remote.info;
import java.lang.annotation.Annotation;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.logging.Logger;
import com.viaoa.remote.multiplexer.annotation.OARemoteInterface;
import com.viaoa.remote.multiplexer.annotation.OARemoteMethod;
import com.viaoa.remote.multiplexer.annotation.OARemoteParameter;
/**
* Internal information about a remote Object. One side (Client/Server) will have the real object, and the other side will have a proxy. Any
* reference that is passed between the C/S will use the name, and then replaced with the real/proxy instance by the receiving side.
*
* @author vvia
*/
public class BindInfo {
private static Logger LOG = Logger.getLogger(BindInfo.class.getName());
// internal name of object, that is past instead of the real object
public short id;
public String name;
public boolean isBroadcast;
public boolean usesQueue;
public String asyncQueueName;
public int asyncQueueSize;
public boolean isOASync;
public WeakReference weakRef;
public Class interfaceClass; // used to create the proxy
private HashMap hmNameToMethod;
private HashMap hmMethod;
public BindInfo(String name, Object obj, Class interfaceClass, ReferenceQueue referenceQueue, boolean bIsBroadcast, String queueName,
int queueSize) {
this.name = name;
if (obj != null) {
setObject(obj, referenceQueue);
}
this.interfaceClass = interfaceClass;
this.isBroadcast = bIsBroadcast;
this.asyncQueueName = queueName;
this.asyncQueueSize = queueSize;
this.usesQueue = (asyncQueueName != null);
OARemoteInterface rc = (OARemoteInterface) interfaceClass.getAnnotation(OARemoteInterface.class);
if (rc != null) {
this.isOASync = rc.isOASync();
}
}
public void setObject(Object obj, ReferenceQueue referenceQueue) {
if (referenceQueue == null) {
weakRef = new WeakReference
© 2015 - 2025 Weber Informatics LLC | Privacy Policy