不同的应用程序服务器采用了不同的机制来执行启动代码(更多信息请参阅参考资料)。
Different application servers have different mechanisms to execute startup code (see Resources for more information).
让我们以一个如何使用RuntimeSpy来诊断和纠正启动代码错误的例子来开始。
Let's begin with examples of how to use the Runtime Spy to diagnose and correct a startup coding error.
可以通过向标记添加onload方法来激活代码,此方法会在页面加载之后立即启动代码。
You activate the code by adding an onload method to the tag, which starts the code right after the page finishes loading.
当某个 Milestone服务在运行时启动时,它将运行其启动代码(如图3 所示)。
When a Milestone service is started at run-time, it runs its start-up code (shown in Figure 3).
设置和销毁都是由链接到SPE程序中的启动代码和在PPE上运行的库代码自动进行处理的;通常您都可以忽略它们。
Setup and tear down are handled automatically by the startup code linked in with the SPE program and by the library code running on the PPE; you can generally ignore them.
Google今天宣布启动代码实验室(Code Labs),开发人员可以从这里找到Google所有重大代码项目的链接。
Google announced today the launch of a new site, Google code Labs, where developers can find links to all the major code projects that Google staff is working on.
从您的角度来看,程序执行是从一个名为main的函数开始的;有些库的启动代码会获得从PPE中传递过来的参数,然后使用这些参数来调用main函数。
From your perspective, execution begins at a function called main ; some library startup code obtains the arguments passed in from the PPE and then calls your main function with those arguments.
当您针对托管代码启动调试时,调试器无响应。
When you start debugging with managed code, the debugger doesn't respond.
当示例代码启动业务过程时,自动地设置CaseIdentifier和CaseFolder字段。
When a business process is launched by the sample code, the CaseIdentifier and CaseFolder fields are set automatically.
添加了代码后,启动Flex应用程序。
After adding the code, start the Flex application. When the Flex application has started, run the producer example on the command line.
您可以使用清单2中给出的代码来启动(激活)和停止GBean。
You can start (activate) and stop the GBean with the code illustrated in Listing 2.
可以看到,没有什么会妨碍您在代码中装入、启动和停止自己的GBean引用。
As you can see, nothing prevents you from loading, starting, and stopping your own GBean references in your code.
这允许我们在崩溃或代码更新之后,远程地(重新)启动显示服务器。
This allowed us to remotely (re) start the display servers after a crash or code update.
在示例代码中,ServerManager类启动并停止一个特定的服务器。
In the example code, the ServerManager class starts and stops a particular server.
另外,使用缓存中的AOT代码也有助于减少启动时间。
In addition, using AOT code from the cache helps reduce startup time.
所有人都知道交付何时启动,并可以规划自己的代码签入是在交付之前还是之后进行。
Everyone knows exactly when the deliveries are going to be initiated and can plan to check in their code before or after that time as necessary.
第二个最常用的t3功能是T3StartupDef,它用于提供应用服务器启动时运行的代码。
Perhaps the second most commonly used t3 feature is T3StartupDef, which is used to provide code that runs when the application server starts.
如果受攻击的程序是由系统管理员启动的,那么恶意代码将作为原始程序的一部分进行执行,给黑客系统中的管理员特权。
If the attacked program was initiated by a system administrator, the malicious code will then run as a part of the original program, giving the attacker administrator privileges on the system.
下面是OSGi特定的代码片段,在bundle启动时被调用,有点像是bundle的main方法。
This is an OSGi-specific piece of code which is invoked when the bundle is started, like a per-bundle main method.
要测试代码,需要为Sphinx创建log目录,启动searchd,然后运行PHP应用程序,如下所示
To test the code, create the log directory for Sphinx, start searchd, then run the PHP application, as shown below.
启动服务器后,可以运行如清单8所示的客户机代码看看会发生什么。
Once you've started the server, you can run the client code shown in Listing 8 to see what happens.
js和nocache.html文件都或多或少地包含了专门用于正确地启动和装入GWT应用程序的样例代码。
The gwt.js and nocache.html files both contain more or less boilerplate code designed to start and load your GWT application properly.
当发生mouseout事件时,代码调用一个函数,它会取消本节前面启动的计时器,然后转换回Inactive状态。
When a mouseout event occurs, your code will call a function that cancels the timer started earlier in this section, and then transitions back to Inactive state.
JIT消除了解释的负担(以额外的启动成本为代价),但是由于若干原因,代码的优化等级仍然是一般般。
JIT compilation removed the overhead of interpretation (at the expense of some additional startup cost), but the level of code optimization was mediocre for several reasons.
安装httpd作为服务将允许我们从代码中异步启动和停止服务器。
Having HTTPD installed as a service will allow us to start and stop the server asynchronously from our code.
我们很快还会启动OpenSpace.Org,这是一个真正的社区网站,允许人们贡献代码。
Very soon we're going to launch OpenSpace.Org - a true community site that allows code contributions.
我们讨论了如何使用模板继承来向servlet代码透明的添加行为(比如启动和提交全局事务)。
We discussed how template inheritance can be used to add behaviors (like starting and committing a global transaction) transparently to the servlet code.
下次启动OCAP RI时,您将看到应用程序代码开始工作了,如图1所示。
Next time you launch the OCAP RI, you'll be rewarded by seeing the application code do its thing, as shown in Figure 1.
这意味着与BankPortal相关联的所有代码都只在客户机启动时提供。
That means all the code associated with the Bank Portal will be delivered only during client startup time.
实现了以下功能的代码:针对所有三种浏览器事件模型连接鼠标事件,启动和取消两种类型的计时器,并连接它们的计时器事件。
You implemented code to: hook cursor events for all three browser event models, start and cancel both types of timers, and hook their timer events.
应用推荐