Package com.sun.midp.midlet

Examples of com.sun.midp.midlet.MIDletSuite


     * Check snapshot permission
     */
    protected void checkPermission() {
        try {
            Scheduler scheduler = Scheduler.getScheduler();
            MIDletSuite midletSuite = scheduler.getMIDletSuite();
            midletSuite.checkForPermission(Permissions.MM_IMAGE_CAPTURING, null);
        } catch (InterruptedException e) {
            throw new SecurityException(
                    "Interrupted while trying to ask the user permission");
        }
    }
View Full Code Here


             * ArrayIndexOutOfBoundsException ->
             * a SecurityException will be thrown !
             */
            int permission = mapPermissions[thePermission];
       
            MIDletSuite midletSuite = Scheduler.getScheduler().getMIDletSuite();
            midletSuite.checkIfPermissionAllowed( permission );
        } catch (SecurityException se) {
            ///*DEBUG:*/ se.printStackTrace();
            throw se;
        } catch (Exception e) {
            ///*DEBUG:*/ e.printStackTrace();
View Full Code Here

                        return;
                    break;
                }
            }
           
            MIDletSuite midletSuite = Scheduler.getScheduler().getMIDletSuite();
            midletSuite.checkIfPermissionAllowed( permission );
        } catch (SecurityException se) {
            ///*DEBUG:*/ se.printStackTrace();
            throw se;
        } catch (Exception e) {
            ///*DEBUG:*/ e.printStackTrace();
View Full Code Here

     */
    public static Image getIcon() {
        MIDletStateHandler midletStateHandler =
            MIDletStateHandler.getMidletStateHandler();

        MIDletSuite suite = midletStateHandler.getMIDletSuite();

        suite.checkIfPermissionAllowed(Permissions.AMS);

        return trustedIcon;
    }
View Full Code Here

    /**
     * Checks if the calling suite has Permissions.MIDP permission.
     * If not, the SecurityException is thrown.
     */
    private void checkMidpPermission() {
        MIDletSuite midletSuite = MIDletStateHandler.
            getMidletStateHandler().getMIDletSuite();

        // if a MIDlet suite is not started, assume the JAM is calling.
        if (midletSuite != null) {
            midletSuite.checkIfPermissionAllowed(Permissions.MIDP);
        }
    }
View Full Code Here

    /**
      * Validates that the method is invoked allowed party.
      */
    private static void checkInvocationAllowed() {
        final MIDletSuite current =
            MIDletStateHandler.getMidletStateHandler().getMIDletSuite();

        if (current != null) {
            current.checkIfPermissionAllowed(Permissions.AMS);
        }
    }
View Full Code Here

     * @param   resName  Image resource name
     * @return  true if image was loaded and created, false otherwise
     */
    private boolean loadCachedImage(ImageData imageData,
                                    String resName) {
        MIDletSuite midletSuite =
            MIDletStateHandler.getMidletStateHandler().getMIDletSuite();
        int suiteId = midletSuite.getID();

        return loadCachedImage0(imageData, suiteId, resName);
    }
View Full Code Here

   * See com.sun.midp.jump.installer.TrustedMIDletSuiteInfo for more
   * information.
   **/
 
        final MIDletStateHandler handler = MIDletStateHandler.getMidletStateHandler();
        MIDletSuite suite = handler.getMIDletSuite();
        if (suite == null) {
           AccessController.doPrivileged(new PrivilegedAction() {
              public Object run() {
     
                try {
View Full Code Here

        String conn;
        String midlet;
        String filter;
        String strSuiteId;
        int id;
        MIDletSuite next = null;

        /*
         * Parse the comma separated values  -
         *  " connection, midlet,  filter, id"
         *  "  midlet,  wakeup, midlet suite ID"
         */
        int comma1 = name.indexOf(',', 0);
        int comma2 = name.indexOf(',', comma1 + 1);
        int comma3 = name.indexOf(',', comma2 + 1);

        if (comma3 == -1) {
            /* Alarm was triggered */
            conn = null;
            midlet = name.substring(0, comma1).trim();
            strSuiteId = name.substring(comma2+1).trim();
        } else {
            conn = name.substring(0, comma1).trim();
            midlet = name.substring(comma1+1, comma2).trim();
            filter = name.substring(comma2+1, comma3).trim();
            strSuiteId = name.substring(comma3+1).trim();
        }

        try {
            /*
             * IMPL_NOTE: here it's assumed that when a suiteId is converted
             * to string the padding zeroes are placed _before_ the value,
             * for ex., suiteId 3 is converted into "00000003".
             * MIDletSuiteStorage.stringToSuiteId() API should be added later.
             */
            id = Integer.parseInt(strSuiteId);
        } catch (NumberFormatException nfe) {
            id = MIDletSuite.UNUSED_SUITE_ID;
        }

        try {
            /*
             * Check to see if the MIDlet is already started.
             */
            if (midletProxyList.isMidletInList(id, midlet)) {
                if (conn != null) {
                    checkInConnectionInternal(conn);
                }

                return;
            }

            next = storage.getMIDletSuite(id, false);
            if (next == null) {
                if (conn != null) {
                    checkInConnectionInternal(conn);
                }

                return;
            }

            if ((next.getPushOptions() & PUSH_OPT_WHEN_ONLY_APP) != 0 &&
                    !onlyAppManagerRunning()) {
                if (conn != null) {
                    checkInConnectionInternal(conn);
                }

                return;
            }

            if (!next.permissionToInterrupt(conn)) {
                // user does not want the interruption
                if (conn != null) {
                    checkInConnectionInternal(conn);
                }

                return;
            }

            if (MIDletSuiteUtils.execute(classSecurityToken, id, midlet,
                                          null)) {
                /* We are in SVM mode, destroy all running MIDlets. */
                MIDletStateHandler.getMidletStateHandler().destroySuite();
            } else if (mvmSingleMidletMode) {
                destroyAppMidlets();
            }
        } catch (Throwable e) {
            // Could not launch requested push entry
            if (conn != null) {
                checkInConnectionInternal(conn);
            }

            if (Logging.TRACE_ENABLED) {
                Logging.trace(e, null);
            }
        } finally {
            if (next != null) {
                next.close();
            }
        }
    }
View Full Code Here

     *
     * @return list of suites
     */
    private void addSuitesAuthorizedBy(Ca ca, Vector suites) {
        int[] suiteIds = null;
        MIDletSuite midletSuite = null;
        InstallInfo installInfo = null;

        suiteIds = suiteStorage.getListOfSuites();

        for (int i = 0; i < suiteIds.length; i++) {
            try {
                midletSuite = suiteStorage.getMIDletSuite(suiteIds[i], false);
            } catch (Throwable t) {
                continue;
            }

            installInfo = ((MIDletSuiteImpl)midletSuite).getInstallInfo();

            String[] authPath = installInfo.getAuthPath();

            if (authPath != null &&
                ca.name.equals(authPath[0])) {
                    suites.addElement(midletSuite);
                continue;
            }

            midletSuite.close();
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.midp.midlet.MIDletSuite

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.