Package javax.microedition.io

Examples of javax.microedition.io.ConnectionNotFoundException


        } else
        {
            return connection;
        }

        throw new ConnectionNotFoundException("Failed to create connection " + name);
    }
View Full Code Here


        if (connection.startsWith("sms://")) {
            try {
                Class.forName("com.sun.midp.io.j2me.sms.Protocol");
            } catch (ClassNotFoundException e) {
                throw new ConnectionNotFoundException(
                    "Connection not supported");
            }

            /*
             * Check the suite permission for the connection
             * and close the connection immediately.
             */
            try {
                midletSuite.checkForPermission(Permissions.SMS_SERVER,
                   connection);
            } catch (InterruptedException ie) {
                throw new InterruptedIOException(
                    "Interrupted while trying to ask the user permission");
            }
        } else if (connection.startsWith("cbs://")) {
            try {
                Class.forName("com.sun.midp.io.j2me.cbs.Protocol");
            } catch (ClassNotFoundException e) {
                throw new ConnectionNotFoundException(
                    "Connection not supported");
            }

            try {
                midletSuite.checkForPermission(Permissions.CBS_SERVER,
View Full Code Here

     * @exception ConnectionNotFoundException if
     * the platform cannot handle the URL requested.
     *
     */
    public boolean dispatch(String URL) throws ConnectionNotFoundException {
        throw new ConnectionNotFoundException("not implemented");
    }
View Full Code Here

     * @exception ConnectionNotFoundException if
     * the platform cannot handle the URL requested.
     *
     */
    public boolean dispatch(String URL) throws ConnectionNotFoundException {
        throw new ConnectionNotFoundException("not implemented");
    }
View Full Code Here

        int channel;

        // Test if 'POWER UP' is needed or a card was changed
        if (!isAlive()) {
            if (cardSlot.isSAT()) {
                throw new ConnectionNotFoundException("SIM not found");
            } else {
                throw new ConnectionNotFoundException("SmartCard not found");
            }
        }

        if (cardSlot.initConnection()) {
            clean();
        }
        if (cardSlot.isSAT()) {
            SIMPresent = true;
        } else {
            SIMPresent = false;
        }
        if (!forSAT && (basicChannelInUse || SIMPresent)) {
            // get another channel for communication.
            byte[] response = exchangeApdu(null, getChannelAPDU);
            if (response.length  == 2) {
                // just got back the status word
                throw new IOException("No logical channel available");
            }
            // new channel number is in the first byte of response
            channel = response[0];
        } else {
            basicChannelInUse = true;
            channel = 0;
        }
       
        selectAPDU[0] = (byte)((selectAPDU[0] & 0xFC) | channel);

        byte[] result = exchangeApdu(null, selectAPDU);

        int sw1 = result[result.length - 2] & 0xFF;
        int sw2 = result[result.length - 1] & 0xFF;
        if ((sw1 << 8) + sw2 != 0x9000) {
            closeChannel(channel);
            throw new ConnectionNotFoundException(
                    "Card application selection failed");
        }
        FCI = result;
        return channel;
    }
View Full Code Here

        String className = Configuration.getProperty
            (connection.substring(0, index).toLowerCase());

        if (className == null || className.length() == 0) {
            throw new ConnectionNotFoundException("Protocol is invalid " +
                "or not supported");
        }

        try {
            ProtocolPush cl = (ProtocolPush)Class.forName(className).newInstance();
            return cl.getInstance();
        } catch (ClassNotFoundException exc) {
            throw new ConnectionNotFoundException("Protocol is not supported");
        } catch (ClassCastException exc) {
            throw new RuntimeException(
                    "System error loading class " + className + ": " + exc);
        } catch (IllegalAccessException exc) {
            throw new RuntimeException(
View Full Code Here

    protected void checkIsNotHost(String connection, boolean checkPort)
        throws IllegalArgumentException, ConnectionNotFoundException {
        HttpUrl url = new HttpUrl(connection);
        // Server connections do not have a host
        if (url.host != null) {
            throw new ConnectionNotFoundException(
                "Connection not supported");
        }

        if (checkPort && url.port == -1) {
            new IllegalArgumentException("Port missing");
View Full Code Here

            streamOutput = null;
            streamInput = null;

            if ((response != null) && (response.indexOf(" 500 ") > -1)) {
                throw new ConnectionNotFoundException(response);
            } else {
                throw ioe;
            }
        }
View Full Code Here

         */
        try {
            Class.forName(
                "com.sun.midp.io.j2me.datagram.Protocol");
        } catch (ClassNotFoundException e) {
            throw new ConnectionNotFoundException(
                "Connection not supported");
        }

        try {
            midletSuite.checkForPermission(Permissions.UDP_SERVER,
View Full Code Here

         */
        try {
            Class.forName(
                "com.sun.midp.io.j2me.serversocket.Socket");
        } catch (ClassNotFoundException e) {
            throw new ConnectionNotFoundException(
                "Connection not supported");
        }

        try {
            midletSuite.checkForPermission(Permissions.TCP_SERVER,
View Full Code Here

TOP

Related Classes of javax.microedition.io.ConnectionNotFoundException

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.