´¿java PHPÒýÇæ——Quercus
ÓÉÓÚ¹«Ë¾ÏîÄ¿µÄÐèÒª£¬×î¾ÔÚÑо¿QuercusÒ»¸ö´¿javaµÄphpÒýÇæ¡£ÏîÄ¿ÕâÁ½¸öÐèÒª×öµÄ¾ÍÊǽ«¸ÃÒýÇæ²Ã¼ô£¬×öÒ»¸öÏà¶Ô°²È«µÄ°æ±¾£¬Ìṩ¸øISVʹÓã¬Í¬Ê±£¬ÔÚÒýÇæÖÐÌṩĬÈϵĽӿڹ©µ÷Óá£ËùÒÔÏÈÑо¿ÁËһϣ¬ÔÚQuercusÒýÇæµÄÖ§³ÖÏ£¬PHPÈçºÎÓëjava¼¯³É¡£
ÒÔÏÂÊÇѧϰµ½µÄ¼¸µã£º
1¡¢Èç¹ûʹÓà Resin-IoC/WebBeansÀ´×éÖ¯Ó¦ÓõķþÎñµ½½Å±¾ÖУ¬ÄÇô½Å±¾ÖоͿÉÒÔÖ±½Ó»ñÈ¡µ½ÅäÖõķþÎñµÄµ¥ÀýʵÀýµÄÒýÓã¬Ê¹Ó÷½Ê½ÈçÏÂ
<?php
$demo_manager = java_bean("DemoeManager");
$demo = $demo_manager->findData("demoId");
foreach ($demo->getDatas() as $data) {
echo $data . "\n";
}
?>
2¡¢ÁíÍâÒ»ÖÖ¿ÉÒÔͨ¹ýnew Java()·½Ê½£¬ÒÔclassÍêÕûÃû³ÆÒÔ¼°¹¹Ô캯Êý²ÎÊý×÷Ϊ²ÎÊýÀ´Éú³É¶ÔÓ¦µÄjava ¶ÔÏó£¬ÀýÈç
<?php
$a = new Java("java.util.Date", 123);
echo $a->time;
?>
3¡¢Quercus»¹Ö§³Ö£¬ÀàËÆÓÚjava µÄÒýÓ÷½Ê½£¬¼´£¬ÔÚPHPÖÐʹÓÃimportÓï¾äÒýÈëclass£¬Ê¹ÓÃnew¹Ø¼ü×ÖÀ´´´½¨¶ÔÏó¡£
<?php
import java.util.Date;
$a = new Date(123);
echo $a->time;
?>
Èç¹ûÊÇʹÓÃResin¿ò¼Ü£¬»á×Ô¶¯¼ÓÔØ WEB-INF/classes/classname.phpÖÐÅäÖõĵÄclass¡£
4¡¢ÔÚQuercusÖУ¬PHPµÄÓï·¨ÓÃÓÚ¼¤»îjava¶ÔÏóµÄ·½·¨£¬ÏÂÃæËµÃ÷Ò»ÏÂͨ³£µÄ·½·¨µ÷ÓúÍÊôÐÔµÄgetºÍset
<?php
import java.util.Date;
$a = new Date(123);
echo $a->getTime(); # calls getTime()
echo $a->setTime(456); # calls setTime(456)
echo $a->time; # calls getTime()
$a->time = 456; # calls setTime(456)
?>
5¡¢ÔÚQuercusÖУ¬javaÀà±»ÒýÈëÁË£¬¾²Ì¬·½Ê½ºÍ¾²Ì¬ÊôÐÔÊÇ¿ÉÒÔ·ÃÎʵÄ
<?php
import java.util.Calendar;
$calendar = Calendar::getInstance();
var_dump($calendar);
?>
»òÕßʹÓÃnew java_class()·½Ê½»ñµÃclass¶ÔÏó
<?php
$class = java_class("java.lang.System");
# System.in
$in = $class->in;
# System.currentTimeInMillis();
$time = $class->currentTimeInMillis();
?>
6¡¢¹ØÓÚjava¶ÔÏóÖеķ½·¨ÖØÔØÎÊÌ⣬PHP±¾ÉíÊDz»Ö§³Öº¯ÊýÖØÔØµÄ£¬¶Ô²ÎÊý¸öÊýµÄÖØÔØÖ§³ÖµÃ»¹²»´í£¬µ«ÊDzÎÊý¸öÊýÏàͬ£¬²ÎÊýÀàÐͲ»Í¬µÄÖØÔØ
Ö§³ÖµÃ¾Í²»Ì«ºÃÁË¡£ÎÒ¾õµÃÊÇÓÉÓÚPHP±¾ÉíËùÀàÐÍÓйء£±ÈÈçÏÂÃæµÄ¶¨ÒåµÄjavaÀà
import com.caucho.quercus.module.Abs
Ïà¹ØÎĵµ£º
ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1 List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......
Ôڳɹ¦ÊµÏÖJavaµ÷ÓÃC++Ö®ºó£¬½ÓÏÂÀ´Ïëµ½ÄÜ·ñͨ¹ýJNAʵÏÖJavaµ÷ÓÃFortran£¬½ñÌìÊÔÑéÁËһϣ¬»¹ÊDZȽÏÈÝÒ׵ġ£
ÍøÉÏÓÐÒ»¸öJavaµ÷ÓÃF95µÄÀý×Ó£¬µ«ÊÇÎÒ¿¼ÂDz»½öҪʵÏÖF95µÄµ÷Ó㬻¹ÒªÊµÏÖF77µÄµ÷Óã¬ËùÒÔ·ÑÁËһЩÖÜÕÛ¡£
ÎÊÌâµÄ¹Ø¼üÔÚÓÚF77Ϊ¹ý³ÌÃû×Ô¶¯Ìí¼ÓÁËÒ»¸öβ²¿µÄÏ»®Ïߣ¬ËùÒÔsub1Õâ¸ö¹ý³Ì£¬µ½JavaÒ»¶Ë£¬¾Í±ä³ÉÁËsub1_£¬ ......
2008 Äê 6 ÔÂ 24 ÈÕ
ÔÎĵØÖ·£º http://www.ibm.com/developerworks/cn/data/library/techarticles/dm-0806wangys/
±¾ÎĽéÉÜ IBM FileNet P8 4.0 Platform ÌṩµÄ Content Java API¡£Ê×ÏÈ¶Ô FileNet P8 Content Engine ºÍ API ½øÐиÅÒª½éÉÜ, ²¢ËµÃ÷ÁËһЩ»ù±¾¸ÅÄî£¬ËæºóÏêϸ½éÉÜÁË FileNet Content EngineÌṩµÄ»ùÓÚ EJB ......
ÖØÔØ£º·½·¨ÃûÏàͬ ·µ»ØÀàÐͺͲÎÊýÖÁÉÙÓÐÒ»Ïͬ£¨²ÎÊý°üÀ¨ÀàÐÍ ºÍ ÊýÁ¿£©
ÖØÐ´£º·¢ÉúÔÚ×ÓÀà ·½·¨Ãû ·µ»ØÀàÐÍ ²ÎÊý¶¼Ïàͬ Ö»ÊǰѸ¸ÀàµÄ´Ë·½·¨ÖØÐÂд¶øÒÑ
Ò»Ö±ÒÔÀ´ÎÒ¶ÔFacther f = new Son()ÕâÑùµÄÒýÓñäÁ¿ÒýÓÃ×ÓÀàµÄʵÀý¶¼²»ÊǺܶ®¡£
»¹ÓоÍÊÇÏòÉÏÏòÏÂתÐÍ
È磺Animal animal = new Dog() // ÒýÓñäÁ¿ÒýÓÃÁËÀ´×Ô×ÓÀàµÄÊ ......
<?php
function delfile($dir,$n) //ɾ³ýDIR·¾¶ÏÂNÌìǰ´´½¨µÄËùÓÐÎļþ;
{
if(is_dir($dir))
{
if($dh=opendir($dir))
{
while (false !== ($file = readdir($dh)))
{
if($file!="." && $file!="..")
{
$fullpath=$dir."/".$file;
if(!is_dir($fullpath)) ......