Package wpn.hdri.ss.client

Examples of wpn.hdri.ss.client.ClientException


            TDataType dout = tLink.dOutput;
            long time = tLink.getLastTimeStamp();
            Timestamp timestamp = new Timestamp(time);
            return new AbstractMap.SimpleImmutableEntry<T, wpn.hdri.ss.data.Timestamp>((T) getDataObject(dout), timestamp);
        } catch (Exception e) {
            throw new ClientException("Read from " + getDeviceName() + "/" + attrName + " failed.", e);
        }
    }
View Full Code Here


            });
            if (rc < 0) {
                throw new IllegalStateException(link.getLastError());
            }
        } catch (Exception e) {
            throw new ClientException("Failed subscribe to " + getDeviceName() + "/" + attrName, e);
        }
    }
View Full Code Here

        Future<TLink> futureLink = tlinks.remove(attrName);
        try {
            final TLink link = futureLink.get();
            int rc = link.close();
            if (rc < 0) {
                throw new ClientException(link.getLastError(), null);
            }
        } catch (Exception e) {
            throw new ClientException("Failed subscribe to " + getDeviceName() + "/" + attrName, e);
        }
    }
View Full Code Here

    }

    private TPropertyQuery getTPropertyQuery(String attrName) throws ClientException {
        TPropertyQuery[] result = TQuery.getPropertyInformation(context, serverName, deviceName, attrName);
        if (result == null) {
            throw new ClientException("Cannot read meta info for " + getDeviceName() + "/" + attrName, new NullPointerException());
        }
        return result[0];
    }
View Full Code Here

    public <T> Map.Entry<T, Timestamp> readAttribute(String attrName) throws ClientException {
        try {
            Map.Entry<T, Long> entry = proxy.readAttributeValueAndTime(attrName);
            return new AbstractMap.SimpleImmutableEntry<T, Timestamp>(entry.getKey(), new Timestamp(entry.getValue()));
        } catch (TangoProxyException devFailed) {
            throw new ClientException("Exception in " + proxy.getName(), devFailed);
        }
    }
View Full Code Here

    @Override
    public <T> void writeAttribute(String attrName, T value) throws ClientException {
        try {
            proxy.writeAttribute(attrName, value);
        } catch (TangoProxyException devFailed) {
            throw new ClientException("Failed to write value[" + value.toString() + "] to " + proxy.getName() + "/" + attrName, devFailed);
        }
    }
View Full Code Here

    @Override
    public boolean isArrayAttribute(String attrName) throws ClientException {
        try {
            TangoAttributeInfoWrapper attributeInfo = proxy.getAttributeInfo(attrName);
            if (attributeInfo == null)
                throw new ClientException("Can not execute query!", new NullPointerException("attributeInfo is null"));
            return SpectrumTangoDataFormat.class.isAssignableFrom(attributeInfo.getFormat().getClass());
        } catch (TangoProxyException e) {
            throw new ClientException("Can not execute query!", e);
        }
    }
View Full Code Here

            };
            proxy.addEventListener(attrName, TangoEvent.CHANGE, listener);

            listeners.put(attrName, listener);
        } catch (TangoProxyException devFailed) {
            throw new ClientException("Exception in " + proxy.getName(), devFailed);
        }
    }
View Full Code Here

    @Override
    public Class<?> getAttributeClass(String attrName) throws ClientException {
        try {
            TangoAttributeInfoWrapper attributeInfo = proxy.getAttributeInfo(attrName);
            if (attributeInfo == null)
                throw new ClientException("Exception in " + proxy.getName(), new NullPointerException("attributeInfo is null"));
            return attributeInfo.getClazz();
        } catch (TangoProxyException e) {
            throw new ClientException("Exception in " + proxy.getName(), e);
        }
    }
View Full Code Here

    public void unsubscribeEvent(String attrName) throws ClientException {
        listeners.remove(attrName);
        try {
            proxy.unsubscribeFromEvent(attrName, TangoEvent.CHANGE);
        } catch (TangoProxyException devFailed) {
            throw new ClientException("Can not unsubscribe event for " + attrName, devFailed);
        }
    }
View Full Code Here

TOP

Related Classes of wpn.hdri.ss.client.ClientException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.