aboutsummaryrefslogblamecommitdiffstats
path: root/infrastructure/rhino1_7R1/javadoc/org/mozilla/javascript/ContextFactory.html
blob: ef61a6f82cdd489ce30b1af4e8570dbfd19682f5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935






































































































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                                                                                                                                                                                                                                                                                 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0) on Thu Mar 06 17:19:15 EST 2008 -->
<TITLE>
ContextFactory (Rhino)
</TITLE>

<META NAME="date" CONTENT="2008-03-06">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="ContextFactory (Rhino)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../org/mozilla/javascript/ContextAction.html" title="interface in org.mozilla.javascript"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/mozilla/javascript/ContextFactory.Listener.html" title="interface in org.mozilla.javascript"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?org/mozilla/javascript/ContextFactory.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="ContextFactory.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.mozilla.javascript</FONT>
<BR>
Class ContextFactory</H2>
<PRE>
java.lang.Object
  <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.mozilla.javascript.ContextFactory</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>ContextFactory</B><DT>extends java.lang.Object</DL>
</PRE>

<P>
Factory class that Rhino runtime uses to create new <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A>
 instances.  A <code>ContextFactory</code> can also notify listeners
 about context creation and release.
 <p>
 When the Rhino runtime needs to create new <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> instance during
 execution of <A HREF="../../../org/mozilla/javascript/Context.html#enter()"><CODE>Context.enter()</CODE></A> or <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A>, it will call
 <A HREF="../../../org/mozilla/javascript/ContextFactory.html#makeContext()"><CODE>makeContext()</CODE></A> of the current global ContextFactory.
 See <A HREF="../../../org/mozilla/javascript/ContextFactory.html#getGlobal()"><CODE>getGlobal()</CODE></A> and <A HREF="../../../org/mozilla/javascript/ContextFactory.html#initGlobal(org.mozilla.javascript.ContextFactory)"><CODE>initGlobal(ContextFactory)</CODE></A>.
 <p>
 It is also possible to use explicit ContextFactory instances for Context
 creation. This is useful to have a set of independent Rhino runtime
 instances under single JVM. See <A HREF="../../../org/mozilla/javascript/ContextFactory.html#call(org.mozilla.javascript.ContextAction)"><CODE>call(ContextAction)</CODE></A>.
 <p>
 The following example demonstrates Context customization to terminate
 scripts running more then 10 seconds and to provide better compatibility
 with JavaScript code using MSIE-specific features.
 <pre>
 import org.mozilla.javascript.*;

 class MyFactory extends ContextFactory
 {

     // Custom <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> to store execution time.
     private static class MyContext extends Context
     {
         long startTime;
     }

     static {
         // Initialize GlobalFactory with custom factory
         ContextFactory.initGlobal(new MyFactory());
     }

     // Override <A HREF="../../../org/mozilla/javascript/ContextFactory.html#makeContext()"><CODE>makeContext()</CODE></A>
     protected Context makeContext()
     {
         MyContext cx = new MyContext();
         // Use pure interpreter mode to allow for
         // <A HREF="../../../org/mozilla/javascript/ContextFactory.html#observeInstructionCount(org.mozilla.javascript.Context, int)"><CODE>observeInstructionCount(Context, int)</CODE></A> to work
         cx.setOptimizationLevel(-1);
         // Make Rhino runtime to call observeInstructionCount
         // each 10000 bytecode instructions
         cx.setInstructionObserverThreshold(10000);
         return cx;
     }

     // Override <A HREF="../../../org/mozilla/javascript/ContextFactory.html#hasFeature(org.mozilla.javascript.Context, int)"><CODE>hasFeature(Context, int)</CODE></A>
     public boolean hasFeature(Context cx, int featureIndex)
     {
         // Turn on maximum compatibility with MSIE scripts
         switch (featureIndex) {
             case <A HREF="../../../org/mozilla/javascript/Context.html#FEATURE_NON_ECMA_GET_YEAR"><CODE>Context.FEATURE_NON_ECMA_GET_YEAR</CODE></A>:
                 return true;

             case <A HREF="../../../org/mozilla/javascript/Context.html#FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME"><CODE>Context.FEATURE_MEMBER_EXPR_AS_FUNCTION_NAME</CODE></A>:
                 return true;

             case <A HREF="../../../org/mozilla/javascript/Context.html#FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER"><CODE>Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER</CODE></A>:
                 return true;

             case <A HREF="../../../org/mozilla/javascript/Context.html#FEATURE_PARENT_PROTO_PROPERTIES"><CODE>Context.FEATURE_PARENT_PROTO_PROPERTIES</CODE></A>:
                 return false;
         }
         return super.hasFeature(cx, featureIndex);
     }

     // Override <A HREF="../../../org/mozilla/javascript/ContextFactory.html#observeInstructionCount(org.mozilla.javascript.Context, int)"><CODE>observeInstructionCount(Context, int)</CODE></A>
     protected void observeInstructionCount(Context cx, int instructionCount)
     {
         MyContext mcx = (MyContext)cx;
         long currentTime = System.currentTimeMillis();
         if (currentTime - mcx.startTime > 10*1000) {
             // More then 10 seconds from Context creation time:
             // it is time to stop the script.
             // Throw Error instance to ensure that script will never
             // get control back through catch or finally.
             throw new Error();
         }
     }

     // Override <A HREF="../../../org/mozilla/javascript/ContextFactory.html#doTopCall(org.mozilla.javascript.Callable, org.mozilla.javascript.Context, org.mozilla.javascript.Scriptable, org.mozilla.javascript.Scriptable, java.lang.Object[])"><CODE>doTopCall(Callable,
                               Context, Scriptable,
                               Scriptable, Object[])</CODE></A>
     protected Object doTopCall(Callable callable,
                                Context cx, Scriptable scope,
                                Scriptable thisObj, Object[] args)
     {
         MyContext mcx = (MyContext)cx;
         mcx.startTime = System.currentTimeMillis();

         return super.doTopCall(callable, cx, scope, thisObj, args);
     }

 }

 </pre>
<P>

<P>
<HR>

<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->

<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;interface</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.Listener.html" title="interface in org.mozilla.javascript">ContextFactory.Listener</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Listener of <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> creation and release events.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#ContextFactory()">ContextFactory</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#addListener(org.mozilla.javascript.ContextFactory.Listener)">addListener</A></B>(<A HREF="../../../org/mozilla/javascript/ContextFactory.Listener.html" title="interface in org.mozilla.javascript">ContextFactory.Listener</A>&nbsp;listener)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#call(org.mozilla.javascript.ContextAction)">call</A></B>(<A HREF="../../../org/mozilla/javascript/ContextAction.html" title="interface in org.mozilla.javascript">ContextAction</A>&nbsp;action)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Call <A HREF="../../../org/mozilla/javascript/ContextAction.html#run(org.mozilla.javascript.Context)"><CODE>ContextAction.run(Context cx)</CODE></A>
 using the <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> instance associated with the current thread.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#checkNotSealed()">checkNotSealed</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../org/mozilla/javascript/GeneratedClassLoader.html" title="interface in org.mozilla.javascript">GeneratedClassLoader</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#createClassLoader(java.lang.ClassLoader)">createClassLoader</A></B>(java.lang.ClassLoader&nbsp;parent)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create class loader for generated classes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;java.lang.Object</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#doTopCall(org.mozilla.javascript.Callable, org.mozilla.javascript.Context, org.mozilla.javascript.Scriptable, org.mozilla.javascript.Scriptable, java.lang.Object[])">doTopCall</A></B>(<A HREF="../../../org/mozilla/javascript/Callable.html" title="interface in org.mozilla.javascript">Callable</A>&nbsp;callable,
          <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A>&nbsp;cx,
          <A HREF="../../../org/mozilla/javascript/Scriptable.html" title="interface in org.mozilla.javascript">Scriptable</A>&nbsp;scope,
          <A HREF="../../../org/mozilla/javascript/Scriptable.html" title="interface in org.mozilla.javascript">Scriptable</A>&nbsp;thisObj,
          java.lang.Object[]&nbsp;args)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Execute top call to script or function.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#enter()">enter</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>use <A HREF="../../../org/mozilla/javascript/ContextFactory.html#enterContext()"><CODE>enterContext()</CODE></A> instead</I></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#enterContext()">enterContext</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get a context associated with the current thread, creating one if need 
 be.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#enterContext(org.mozilla.javascript.Context)">enterContext</A></B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A>&nbsp;cx)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get a Context associated with the current thread, using the given 
 Context if need be.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#exit()">exit</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>Use <A HREF="../../../org/mozilla/javascript/Context.html#exit()"><CODE>Context.exit()</CODE></A> instead.</I></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.ClassLoader</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#getApplicationClassLoader()">getApplicationClassLoader</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get ClassLoader to use when searching for Java classes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;org.mozilla.javascript.xml.XMLLib.Factory</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#getE4xImplementationFactory()">getE4xImplementationFactory</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Provides a default
 <CODE>XMLLib.Factory</CODE>
 to be used by the <code>Context</code> instances produced by this
 factory.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../org/mozilla/javascript/ContextFactory.html" title="class in org.mozilla.javascript">ContextFactory</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#getGlobal()">getGlobal</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get global ContextFactory.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#hasExplicitGlobal()">hasExplicitGlobal</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Check if global factory was set.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#hasFeature(org.mozilla.javascript.Context, int)">hasFeature</A></B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A>&nbsp;cx,
           int&nbsp;featureIndex)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Implementation of <A HREF="../../../org/mozilla/javascript/Context.html#hasFeature(int)"><CODE>Context.hasFeature(int featureIndex)</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#initApplicationClassLoader(java.lang.ClassLoader)">initApplicationClassLoader</A></B>(java.lang.ClassLoader&nbsp;loader)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set explicit class loader to use when searching for Java classes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#initGlobal(org.mozilla.javascript.ContextFactory)">initGlobal</A></B>(<A HREF="../../../org/mozilla/javascript/ContextFactory.html" title="class in org.mozilla.javascript">ContextFactory</A>&nbsp;factory)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set global ContextFactory.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#isSealed()">isSealed</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if this is a sealed ContextFactory.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#makeContext()">makeContext</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create new <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> instance to be associated with the current
 thread.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#observeInstructionCount(org.mozilla.javascript.Context, int)">observeInstructionCount</A></B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A>&nbsp;cx,
                        int&nbsp;instructionCount)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Implementation of
 <A HREF="../../../org/mozilla/javascript/Context.html#observeInstructionCount(int)"><CODE>Context.observeInstructionCount(int instructionCount)</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#onContextCreated(org.mozilla.javascript.Context)">onContextCreated</A></B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A>&nbsp;cx)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#onContextReleased(org.mozilla.javascript.Context)">onContextReleased</A></B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A>&nbsp;cx)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#removeListener(org.mozilla.javascript.ContextFactory.Listener)">removeListener</A></B>(<A HREF="../../../org/mozilla/javascript/ContextFactory.Listener.html" title="interface in org.mozilla.javascript">ContextFactory.Listener</A>&nbsp;listener)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/mozilla/javascript/ContextFactory.html#seal()">seal</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Seal this ContextFactory so any attempt to modify it like to add or
 remove its listeners will throw an exception.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="ContextFactory()"><!-- --></A><H3>
ContextFactory</H3>
<PRE>
public <B>ContextFactory</B>()</PRE>
<DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="getGlobal()"><!-- --></A><H3>
getGlobal</H3>
<PRE>
public static <A HREF="../../../org/mozilla/javascript/ContextFactory.html" title="class in org.mozilla.javascript">ContextFactory</A> <B>getGlobal</B>()</PRE>
<DL>
<DD>Get global ContextFactory.
<P>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../org/mozilla/javascript/ContextFactory.html#hasExplicitGlobal()"><CODE>hasExplicitGlobal()</CODE></A>, 
<A HREF="../../../org/mozilla/javascript/ContextFactory.html#initGlobal(org.mozilla.javascript.ContextFactory)"><CODE>initGlobal(ContextFactory)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="hasExplicitGlobal()"><!-- --></A><H3>
hasExplicitGlobal</H3>
<PRE>
public static boolean <B>hasExplicitGlobal</B>()</PRE>
<DL>
<DD>Check if global factory was set.
 Return true to indicate that <A HREF="../../../org/mozilla/javascript/ContextFactory.html#initGlobal(org.mozilla.javascript.ContextFactory)"><CODE>initGlobal(ContextFactory)</CODE></A> was
 already called and false to indicate that the global factory was not
 explicitly set.
<P>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../org/mozilla/javascript/ContextFactory.html#getGlobal()"><CODE>getGlobal()</CODE></A>, 
<A HREF="../../../org/mozilla/javascript/ContextFactory.html#initGlobal(org.mozilla.javascript.ContextFactory)"><CODE>initGlobal(ContextFactory)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="initGlobal(org.mozilla.javascript.ContextFactory)"><!-- --></A><H3>
initGlobal</H3>
<PRE>
public static void <B>initGlobal</B>(<A HREF="../../../org/mozilla/javascript/ContextFactory.html" title="class in org.mozilla.javascript">ContextFactory</A>&nbsp;factory)</PRE>
<DL>
<DD>Set global ContextFactory.
 The method can only be called once.
<P>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../org/mozilla/javascript/ContextFactory.html#getGlobal()"><CODE>getGlobal()</CODE></A>, 
<A HREF="../../../org/mozilla/javascript/ContextFactory.html#hasExplicitGlobal()"><CODE>hasExplicitGlobal()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="makeContext()"><!-- --></A><H3>
makeContext</H3>
<PRE>
protected <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A> <B>makeContext</B>()</PRE>
<DL>
<DD>Create new <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> instance to be associated with the current
 thread.
 This is a callback method used by Rhino to create <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A>
 instance when it is necessary to associate one with the current
 execution thread. <tt>makeContext()</tt> is allowed to call
 <A HREF="../../../org/mozilla/javascript/Context.html#seal(java.lang.Object)"><CODE>Context.seal(Object)</CODE></A> on the result to prevent
 <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> changes by hostile scripts or applets.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="hasFeature(org.mozilla.javascript.Context, int)"><!-- --></A><H3>
hasFeature</H3>
<PRE>
protected boolean <B>hasFeature</B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A>&nbsp;cx,
                             int&nbsp;featureIndex)</PRE>
<DL>
<DD>Implementation of <A HREF="../../../org/mozilla/javascript/Context.html#hasFeature(int)"><CODE>Context.hasFeature(int featureIndex)</CODE></A>.
 This can be used to customize <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> without introducing
 additional subclasses.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getE4xImplementationFactory()"><!-- --></A><H3>
getE4xImplementationFactory</H3>
<PRE>
protected org.mozilla.javascript.xml.XMLLib.Factory <B>getE4xImplementationFactory</B>()</PRE>
<DL>
<DD>Provides a default
 <CODE>XMLLib.Factory</CODE>
 to be used by the <code>Context</code> instances produced by this
 factory. See <A HREF="../../../org/mozilla/javascript/Context.html#getE4xImplementationFactory()"><CODE>Context.getE4xImplementationFactory()</CODE></A> for details.
 
 May return null, in which case E4X functionality is not supported in
 Rhino.
 
 The default implementation now prefers the DOM3 E4X implementation.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="createClassLoader(java.lang.ClassLoader)"><!-- --></A><H3>
createClassLoader</H3>
<PRE>
protected <A HREF="../../../org/mozilla/javascript/GeneratedClassLoader.html" title="interface in org.mozilla.javascript">GeneratedClassLoader</A> <B>createClassLoader</B>(java.lang.ClassLoader&nbsp;parent)</PRE>
<DL>
<DD>Create class loader for generated classes.
 This method creates an instance of the default implementation
 of <A HREF="../../../org/mozilla/javascript/GeneratedClassLoader.html" title="interface in org.mozilla.javascript"><CODE>GeneratedClassLoader</CODE></A>. Rhino uses this interface to load
 generated JVM classes when no <A HREF="../../../org/mozilla/javascript/SecurityController.html" title="class in org.mozilla.javascript"><CODE>SecurityController</CODE></A>
 is installed.
 Application can override the method to provide custom class loading.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getApplicationClassLoader()"><!-- --></A><H3>
getApplicationClassLoader</H3>
<PRE>
public final java.lang.ClassLoader <B>getApplicationClassLoader</B>()</PRE>
<DL>
<DD>Get ClassLoader to use when searching for Java classes.
 Unless it was explicitly initialized with
 <A HREF="../../../org/mozilla/javascript/ContextFactory.html#initApplicationClassLoader(java.lang.ClassLoader)"><CODE>initApplicationClassLoader(ClassLoader)</CODE></A> the method returns
 null to indicate that Thread.getContextClassLoader() should be used.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="initApplicationClassLoader(java.lang.ClassLoader)"><!-- --></A><H3>
initApplicationClassLoader</H3>
<PRE>
public final void <B>initApplicationClassLoader</B>(java.lang.ClassLoader&nbsp;loader)</PRE>
<DL>
<DD>Set explicit class loader to use when searching for Java classes.
<P>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../org/mozilla/javascript/ContextFactory.html#getApplicationClassLoader()"><CODE>getApplicationClassLoader()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="doTopCall(org.mozilla.javascript.Callable, org.mozilla.javascript.Context, org.mozilla.javascript.Scriptable, org.mozilla.javascript.Scriptable, java.lang.Object[])"><!-- --></A><H3>
doTopCall</H3>
<PRE>
protected java.lang.Object <B>doTopCall</B>(<A HREF="../../../org/mozilla/javascript/Callable.html" title="interface in org.mozilla.javascript">Callable</A>&nbsp;callable,
                                     <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A>&nbsp;cx,
                                     <A HREF="../../../org/mozilla/javascript/Scriptable.html" title="interface in org.mozilla.javascript">Scriptable</A>&nbsp;scope,
                                     <A HREF="../../../org/mozilla/javascript/Scriptable.html" title="interface in org.mozilla.javascript">Scriptable</A>&nbsp;thisObj,
                                     java.lang.Object[]&nbsp;args)</PRE>
<DL>
<DD>Execute top call to script or function.
 When the runtime is about to execute a script or function that will
 create the first stack frame with scriptable code, it calls this method
 to perform the real call. In this way execution of any script
 happens inside this function.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="observeInstructionCount(org.mozilla.javascript.Context, int)"><!-- --></A><H3>
observeInstructionCount</H3>
<PRE>
protected void <B>observeInstructionCount</B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A>&nbsp;cx,
                                       int&nbsp;instructionCount)</PRE>
<DL>
<DD>Implementation of
 <A HREF="../../../org/mozilla/javascript/Context.html#observeInstructionCount(int)"><CODE>Context.observeInstructionCount(int instructionCount)</CODE></A>.
 This can be used to customize <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> without introducing
 additional subclasses.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="onContextCreated(org.mozilla.javascript.Context)"><!-- --></A><H3>
onContextCreated</H3>
<PRE>
protected void <B>onContextCreated</B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A>&nbsp;cx)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="onContextReleased(org.mozilla.javascript.Context)"><!-- --></A><H3>
onContextReleased</H3>
<PRE>
protected void <B>onContextReleased</B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A>&nbsp;cx)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="addListener(org.mozilla.javascript.ContextFactory.Listener)"><!-- --></A><H3>
addListener</H3>
<PRE>
public final void <B>addListener</B>(<A HREF="../../../org/mozilla/javascript/ContextFactory.Listener.html" title="interface in org.mozilla.javascript">ContextFactory.Listener</A>&nbsp;listener)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="removeListener(org.mozilla.javascript.ContextFactory.Listener)"><!-- --></A><H3>
removeListener</H3>
<PRE>
public final void <B>removeListener</B>(<A HREF="../../../org/mozilla/javascript/ContextFactory.Listener.html" title="interface in org.mozilla.javascript">ContextFactory.Listener</A>&nbsp;listener)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="isSealed()"><!-- --></A><H3>
isSealed</H3>
<PRE>
public final boolean <B>isSealed</B>()</PRE>
<DL>
<DD>Checks if this is a sealed ContextFactory.
<P>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../org/mozilla/javascript/ContextFactory.html#seal()"><CODE>seal()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="seal()"><!-- --></A><H3>
seal</H3>
<PRE>
public final void <B>seal</B>()</PRE>
<DL>
<DD>Seal this ContextFactory so any attempt to modify it like to add or
 remove its listeners will throw an exception.
<P>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../org/mozilla/javascript/ContextFactory.html#isSealed()"><CODE>isSealed()</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="checkNotSealed()"><!-- --></A><H3>
checkNotSealed</H3>
<PRE>
protected final void <B>checkNotSealed</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="call(org.mozilla.javascript.ContextAction)"><!-- --></A><H3>
call</H3>
<PRE>
public final java.lang.Object <B>call</B>(<A HREF="../../../org/mozilla/javascript/ContextAction.html" title="interface in org.mozilla.javascript">ContextAction</A>&nbsp;action)</PRE>
<DL>
<DD>Call <A HREF="../../../org/mozilla/javascript/ContextAction.html#run(org.mozilla.javascript.Context)"><CODE>ContextAction.run(Context cx)</CODE></A>
 using the <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript"><CODE>Context</CODE></A> instance associated with the current thread.
 If no Context is associated with the thread, then
 <A HREF="../../../org/mozilla/javascript/ContextFactory.html#makeContext()"><CODE>makeContext()</CODE></A> will be called to construct
 new Context instance. The instance will be temporary associated
 with the thread during call to <A HREF="../../../org/mozilla/javascript/ContextAction.html#run(org.mozilla.javascript.Context)"><CODE>ContextAction.run(Context)</CODE></A>.
<P>
<DD><DL>
<DT><B>See Also:</B><DD><A HREF="../../../org/mozilla/javascript/ContextFactory.html#call(org.mozilla.javascript.ContextAction)"><CODE>call(ContextAction)</CODE></A>, 
<A HREF="../../../org/mozilla/javascript/Context.html#call(org.mozilla.javascript.ContextFactory, org.mozilla.javascript.Callable, org.mozilla.javascript.Scriptable, org.mozilla.javascript.Scriptable, java.lang.Object[])"><CODE>Context.call(ContextFactory factory, Callable callable,
                   Scriptable scope, Scriptable thisObj,
                   Object[] args)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="enterContext()"><!-- --></A><H3>
enterContext</H3>
<PRE>
public <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A> <B>enterContext</B>()</PRE>
<DL>
<DD>Get a context associated with the current thread, creating one if need 
 be. The Context stores the execution state of the JavaScript engine, so 
 it is required that the context be entered before execution may begin. 
 Once a thread has entered a Context, then getCurrentContext() may be 
 called to find the context that is associated with the current thread.
 <p>
 Calling <code>enterContext()</code> will return either the Context 
 currently associated with the thread, or will create a new context and 
 associate it with the current thread. Each call to 
 <code>enterContext()</code> must have a matching call to 
 <A HREF="../../../org/mozilla/javascript/Context.html#exit()"><CODE>Context.exit()</CODE></A>.
 <pre>
      Context cx = contextFactory.enterContext();
      try {
          ...
          cx.evaluateString(...);
      } finally {
          Context.exit();
      }
 </pre>
 Instead of using <tt>enterContext()</tt>, <tt>exit()</tt> pair consider 
 using <A HREF="../../../org/mozilla/javascript/ContextFactory.html#call(org.mozilla.javascript.ContextAction)"><CODE>call(ContextAction)</CODE></A> which guarantees proper association 
 of Context instances with the current thread.
 With this method the above example becomes:
 <pre>
      ContextFactory.call(new ContextAction() {
          public Object run(Context cx) {
              ...
              cx.evaluateString(...);
              return null;
          }
      });
 </pre>
<P>
<DD><DL>

<DT><B>Returns:</B><DD>a Context associated with the current thread<DT><B>See Also:</B><DD><A HREF="../../../org/mozilla/javascript/Context.html#getCurrentContext()"><CODE>Context.getCurrentContext()</CODE></A>, 
<A HREF="../../../org/mozilla/javascript/Context.html#exit()"><CODE>Context.exit()</CODE></A>, 
<A HREF="../../../org/mozilla/javascript/ContextFactory.html#call(org.mozilla.javascript.ContextAction)"><CODE>call(ContextAction)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="enter()"><!-- --></A><H3>
enter</H3>
<PRE>
public final <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A> <B>enter</B>()</PRE>
<DL>
<DD><B>Deprecated.</B>&nbsp;<I>use <A HREF="../../../org/mozilla/javascript/ContextFactory.html#enterContext()"><CODE>enterContext()</CODE></A> instead</I>
<P>
<DD><DL>

<DT><B>Returns:</B><DD>a Context associated with the current thread</DL>
</DD>
</DL>
<HR>

<A NAME="exit()"><!-- --></A><H3>
exit</H3>
<PRE>
public final void <B>exit</B>()</PRE>
<DL>
<DD><B>Deprecated.</B>&nbsp;<I>Use <A HREF="../../../org/mozilla/javascript/Context.html#exit()"><CODE>Context.exit()</CODE></A> instead.</I>
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="enterContext(org.mozilla.javascript.Context)"><!-- --></A><H3>
enterContext</H3>
<PRE>
public final <A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A> <B>enterContext</B>(<A HREF="../../../org/mozilla/javascript/Context.html" title="class in org.mozilla.javascript">Context</A>&nbsp;cx)</PRE>
<DL>
<DD>Get a Context associated with the current thread, using the given 
 Context if need be.
 <p>
 The same as <code>enterContext()</code> except that <code>cx</code>
 is associated with the current thread and returned if the current thread
 has no associated context and <code>cx</code> is not associated with any
 other thread.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>cx</CODE> - a Context to associate with the thread if possible
<DT><B>Returns:</B><DD>a Context associated with the current thread
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalStateException</CODE> - if <code>cx</code> is already associated
 with a different thread<DT><B>See Also:</B><DD><A HREF="../../../org/mozilla/javascript/ContextFactory.html#enterContext()"><CODE>enterContext()</CODE></A>, 
<A HREF="../../../org/mozilla/javascript/ContextFactory.html#call(org.mozilla.javascript.ContextAction)"><CODE>call(ContextAction)</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../org/mozilla/javascript/ContextAction.html" title="interface in org.mozilla.javascript"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/mozilla/javascript/ContextFactory.Listener.html" title="interface in org.mozilla.javascript"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html?org/mozilla/javascript/ContextFactory.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="ContextFactory.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>

</BODY>
</HTML>