Examples of MIDletStateHandler


Examples of com.sun.midp.midlet.MIDletStateHandler

     * @return the current application.
     */
    static AppProxy getCurrent() {
        synchronized (mutex) {
            if (currentApp == null) {
                MIDletStateHandler mh =
                    MIDletStateHandler.getMidletStateHandler();
                MIDletSuite msuite = mh.getMIDletSuite();
                try {
                    currentApp = (msuite != null) ?
                        new AppProxy(msuite,
                                     mh.getFirstRunningMidlet(),
                                     null) :
                        new AppProxy(MIDletSuite.INTERNAL_SUITE_ID, "");
                } catch (ClassNotFoundException cnfe) {
                    return null;
                }
View Full Code Here

Examples of com.sun.midp.midlet.MIDletStateHandler

     *
     * @exception SecurityException if the suite calling does not have the
     * the AMS permission
     */
    public static Image getIcon() {
        MIDletStateHandler midletStateHandler =
            MIDletStateHandler.getMidletStateHandler();

        MIDletSuite suite = midletStateHandler.getMIDletSuite();

        suite.checkIfPermissionAllowed(Permissions.AMS);

        return trustedIcon;
    }
View Full Code Here

Examples of com.sun.midp.midlet.MIDletStateHandler

     * Overridden from TestCase parent. This method will kick off each
     * individual test
     */
    public void runTests() {
       
        MIDletStateHandler msHandler = MIDletStateHandler.getMidletStateHandler();
        // Start a new instance of DummyMIDlet
        try {
            msHandler.startMIDlet("com.sun.midp.util.DummyMIDlet",
                                  "DummyMIDlet");
        } catch (Exception cnf) {
            return;
        }
       
View Full Code Here

Examples of com.sun.midp.midlet.MIDletStateHandler

        if (!initMidpNativeStates(home)) {
           throw new RuntimeException("MIDP native initialization failed");
        }

  /**
   * Making the runtime believe that this is a trusted midlet suite.
   * This is needed because in midp's code, security check is often done
   * by checking the executing midlet suite's security token.
   * 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

Examples of com.sun.midp.midlet.MIDletStateHandler

     *   calling thread while this method is waiting to preempt the
     *   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.");
        }
View Full Code Here

Examples of com.sun.midp.midlet.MIDletStateHandler

     * @return the registry for the Framework class
     */
    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) {
View Full Code Here

Examples of com.sun.midp.midlet.MIDletStateHandler

    public static byte[] readJarEntry(SecurityToken securityToken,
                               String jarFilePath, String entryName)
            throws IOException {

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

            midletSuite.checkIfPermissionAllowed(Permissions.AMS);
        } else {
            securityToken.checkIfPermissionAllowed(Permissions.AMS);
        }
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.