Package javax.websocket

Examples of javax.websocket.Decoder


    public Object decodeBinary(final Class<?> targetType, final byte[] bytes) throws DecodeException {
        List<InstanceHandle<? extends Decoder>> decoders = binaryDecoders.get(targetType);
        if (decoders != null) {
            for (InstanceHandle<? extends Decoder> decoderHandle : decoders) {
                Decoder decoder = decoderHandle.getInstance();
                if (decoder instanceof Decoder.Binary) {
                    if (((Decoder.Binary) decoder).willDecode(ByteBuffer.wrap(bytes))) {
                        return ((Decoder.Binary) decoder).decode(ByteBuffer.wrap(bytes));
                    }
                } else {
View Full Code Here


                if (param.role == Role.PATH_PARAM)
                {
                    int idx = param.index;
                    String rawvalue = pathParams.get(param.getPathParamName());

                    Decoder decoder = session.getDecoderFactory().getDecoderFor(param.type);
                    if (decoder instanceof Decoder.Text<?>)
                    {
                        Decoder.Text<?> textDecoder = (Decoder.Text<?>)decoder;
                        try
                        {
View Full Code Here

    public Wrapper newWrapper(DecoderMetadata metadata)
    {
        Class<? extends Decoder> decoderClass = metadata.getCoderClass();
        try
        {
            Decoder decoder = decoderClass.newInstance();
            return new Wrapper(decoder,metadata);
        }
        catch (InstantiationException | IllegalAccessException e)
        {
            throw new IllegalStateException("Unable to instantiate Decoder: " + decoderClass.getName());
View Full Code Here

            return decodePrimitive(targetType, message);
        }
        List<InstanceHandle<? extends Decoder>> decoders = textDecoders.get(targetType);
        if (decoders != null) {
            for (InstanceHandle<? extends Decoder> decoderHandle : decoders) {
                Decoder decoder = decoderHandle.getInstance();
                if (decoder instanceof Decoder.Text) {
                    if (((Decoder.Text) decoder).willDecode(message)) {
                        return ((Decoder.Text) decoder).decode(message);
                    }
                } else {
View Full Code Here

    public Object decodeBinary(final Class<?> targetType, final byte[] bytes) throws DecodeException {
        List<InstanceHandle<? extends Decoder>> decoders = binaryDecoders.get(targetType);
        if (decoders != null) {
            for (InstanceHandle<? extends Decoder> decoderHandle : decoders) {
                Decoder decoder = decoderHandle.getInstance();
                if (decoder instanceof Decoder.Binary) {
                    if (((Decoder.Binary) decoder).willDecode(ByteBuffer.wrap(bytes))) {
                        return ((Decoder.Binary) decoder).decode(ByteBuffer.wrap(bytes));
                    }
                } else {
View Full Code Here

        List<DecoderEntry> result = new ArrayList<>();
        for (Class<? extends Decoder> decoderClazz : decoderClazzes) {
            // Need to instantiate decoder to ensure it is valid and that
            // deployment can be failed if it is not
            @SuppressWarnings("unused")
            Decoder instance;
            try {
                instance = decoderClazz.newInstance();
            } catch (InstantiationException | IllegalAccessException e) {
                throw new DeploymentException(
View Full Code Here

        List<DecoderEntry> result = new ArrayList<>();
        for (Class<? extends Decoder> decoderClazz : decoderClazzes) {
            // Need to instantiate decoder to ensure it is valid and that
            // deployment can be failed if it is not
            @SuppressWarnings("unused")
            Decoder instance;
            try {
                instance = decoderClazz.newInstance();
            } catch (InstantiationException | IllegalAccessException e) {
                throw new DeploymentException(
View Full Code Here

    public Wrapper newWrapper(DecoderMetadata metadata)
    {
        Class<? extends Decoder> decoderClass = metadata.getCoderClass();
        try
        {
            Decoder decoder = decoderClass.newInstance();
            return new Wrapper(decoder,metadata);
        }
        catch (InstantiationException | IllegalAccessException e)
        {
            throw new IllegalStateException("Unable to instantiate Decoder: " + decoderClass.getName());
View Full Code Here

        List<DecoderEntry> result = new ArrayList<DecoderEntry>();
        for (Class<? extends Decoder> decoderClazz : decoderClazzes) {
            // Need to instantiate decoder to ensure it is valid and that
            // deployment can be failed if it is not
            @SuppressWarnings("unused")
            Decoder instance;
            try {
                instance = decoderClazz.newInstance();
            } catch (InstantiationException e) {
                throw new DeploymentException(
View Full Code Here

        List<DecoderEntry> result = new ArrayList<>();
        if (decoderClazzes != null) {
            for (Class<? extends Decoder> decoderClazz : decoderClazzes) {
                // Need to instantiate decoder to ensure it is valid and that
                // deployment can be failed if it is not
                @SuppressWarnings("unused")
                Decoder instance;
                try {
                    instance = decoderClazz.newInstance();
                } catch (InstantiationException | IllegalAccessException e) {
                    throw new DeploymentException(
View Full Code Here

TOP

Related Classes of javax.websocket.Decoder

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.