Examples of MIDletSuite


Examples of com.sun.midp.midlet.MIDletSuite

     * Disable a list suites. Closes each suite.
     *
     * @param suites list of MIDlet suites
     */
    private void disableSuites(Vector suites) {
        MIDletSuite midletSuite = null;

        for (int i = 0; i < suites.size(); i++) {
            midletSuite = (MIDletSuite)suites.elementAt(i);
            try {
                suiteStorage.disable(midletSuite.getID());
            } catch (Throwable t) {
                // nothing can be done
            }

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

Examples of com.sun.midp.midlet.MIDletSuite

     * Enable a list suites. Closes each suite.
     *
     * @param suites list of MIDlet suites
     */
    private void enableSuites(Vector suites) {
        MIDletSuite midletSuite = null;

        for (int i = 0; i < suites.size(); i++) {
            midletSuite = (MIDletSuite)suites.elementAt(i);
            try {
                suiteStorage.enable(midletSuite.getID());
            } catch (Throwable t) {
                // nothing can be done
            }

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

Examples of com.sun.midp.midlet.MIDletSuite

     *   display.
     */
    private void checkForPermission(String name)
            throws InterruptedIOException {
        MIDletStateHandler midletStateHandler;
        MIDletSuite midletSuite;

        midletStateHandler = MIDletStateHandler.getMidletStateHandler();
        midletSuite = midletStateHandler.getMIDletSuite();

        if (midletSuite == null) {
            throw new IllegalStateException("This class can't be used " +
                "before a suite is started.");
        }

        name = protocol + ":" + name;

        try {
            midletSuite.checkForPermission(Permissions.HTTP, name);
            ownerTrusted = midletSuite.isTrusted();
            permissionChecked = true;
        } catch (InterruptedException ie) {
            throw new InterruptedIOException(
                "Interrupted while trying to ask the user permission");
        }
View Full Code Here

Examples of com.sun.midp.midlet.MIDletSuite

     */
    public static MIDletProxyList getMIDletProxyList(SecurityToken token) {
        if (token != null) {
            token.checkIfPermissionAllowed(Permissions.AMS);
        } else {
            MIDletSuite midletSuite = MIDletStateHandler.
                getMidletStateHandler().getMIDletSuite();

            midletSuite.checkIfPermissionAllowed(Permissions.AMS);
        }

        return midletProxyList;
    }
View Full Code Here

Examples of com.sun.midp.midlet.MIDletSuite

    RegistryImpl getRegistry() {
  try {
      SecurityToken token = getSecurityToken();
      MIDletStateHandler mstate =
    MIDletStateHandler.getMidletStateHandler();
            MIDletSuite msuite = mstate.getMIDletSuite();
      msuite.setTempProperty(token, "MIDlet-1",
           "CHAPI Tests,," + classname);

      return RegistryImpl.getRegistryImpl(classname, token);
  } catch (SecurityException sx) {
      fail("SecurityException: can't setTempProperty");
View Full Code Here

Examples of com.sun.midp.midlet.MIDletSuite

     */
    public static void removeRecordStoresForSuite(SecurityToken token,
            int id) {

  if (token == null) {
            MIDletSuite midletSuite =
                MIDletStateHandler.getMidletStateHandler().getMIDletSuite();

            // if a MIDlet suite is not scheduled, assume the JAM is calling.
            if (midletSuite != null) {
                midletSuite.checkIfPermissionAllowed(Permissions.AMS);
            }
        } else {
            token.checkIfPermissionAllowed(Permissions.AMS);
        }

View Full Code Here

Examples of com.sun.midp.midlet.MIDletSuite

     * @return an object with the class name and display name of
     * the suite's MIDlet-1 property
     */
    static MIDletInfo getFirstMIDletOfSuite(int suiteId,
            MIDletSuiteStorage midletSuiteStorage) {
        MIDletSuite ms = null;
        String name = null;

        try {
            ms = midletSuiteStorage.getMIDletSuite(suiteId, false);
            name = ms.getProperty("MIDlet-1");
        } catch (Exception e) {
            throw new RuntimeException("midlet properties corrupted");
        } finally {
            if (ms != null) {
                ms.close();
            }
        }

        if (name == null) {
            throw new RuntimeException("MIDlet-1 missing");
View Full Code Here

Examples of com.sun.midp.midlet.MIDletSuite

        // Quick check of filter to be spec complaint
        if (filter == null) {
            throw new IllegalArgumentException("filter is null");
        }

        final MIDletSuite midletSuite = getMIDletSuite();

        /* This method should only be called by running MIDlets. */
        if (midletSuite == null) {
            throw new IllegalStateException("Not in a MIDlet context");
        }

        /*
         * Validate parameters and Push connection availability
         */
        checkMidlet(midletSuite, midlet);
        /*
         * IMPL_NOTE: as checkRegistration will need to parse
         *  connection and filter anyway, it might be a good
         *  idea to save the results
         */
        ConnectionRegistry.checkRegistration(c, midlet, filter);

        /*
         * Check permissions.
         */
        try {
            midletSuite.checkForPermission(Permissions.PUSH, null);
        } catch (InterruptedException ie) {
            throw new InterruptedIOException(
                "Interrupted while trying to ask the user permission");
        }

View Full Code Here

Examples of com.sun.midp.midlet.MIDletSuite

        /* Verify the connection string before using it. */
        if (connection == null || connection.length() == 0) {
            return false;
        }

        final MIDletSuite midletSuite = getMIDletSuite();
        if (midletSuite == null) {
            return false;
        }

        return ConnectionRegistry.unregisterConnection(midletSuite, connection);
View Full Code Here

Examples of com.sun.midp.midlet.MIDletSuite

     * @exception SecurityException if the caller does not have permission
     *   to install software
     */
    public static MIDletSuiteStorage getMIDletSuiteStorage()
            throws SecurityException {
        MIDletSuite midletSuite =
            MIDletStateHandler.getMidletStateHandler().getMIDletSuite();

        if (midletSuite == null) {
            throw new
                IllegalStateException("This method can't be called before " +
                                      "a suite is started.");
        }

        midletSuite.checkIfPermissionAllowed(Permissions.AMS);

        return getMasterStorage();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.