timeout = 1; if ($request->send()){ $rst = $request->responseText; } // $rst = html_entity_decode($rst); $rst = uft8html2utf8($rst); $xmls = new XMLStruct(); $xmls->open($rst); if($xmls->doesExist('/rss/channel/title')) { $title=$xmls->getValue('/rss/channel/title'); } if($xmls->doesExist('/rss/channel/link')) { $link=$xmls->getValue('/rss/channel/link'); } $rankicon = ($data['icon_use']=='T')?" style=\"margin:4px 0px 0px 0px;padding:0px;list-style:none;margin-left:1px;\"":""; list($me2dayer, $temp) = split('님의 ', $title); $me2day .= $data['md_header']."\n"; $me2day .= "\n"; $me2day .= $data['md_footer']; } return $me2day; } function Me2DayConfig_ko($plugin) { global $service; $manifest = ''; $manifest .= ''.CRLF; $manifest .= ''.CRLF; $manifest .= ' '.CRLF; $manifest .= '
'.CRLF; $manifest .= ' '; $manifest .= ' '.CRLF; $manifest .= ' http://me2day.net/doa라면 doa를 입력하면 됩니다. 하나 이상의 주소를 입력하려면 주소와 주소를 쉼표로 구분(예: doa,taemy)하면 됩니다. 주소와 주소 사이에는 공백이 있어서는 안됩니다.'.CRLF; $manifest .= ' ]]>'.CRLF; $manifest .= ' '.CRLF; $manifest .= ' '.CRLF; $manifest .= '
'.CRLF; $manifest .= '
'.CRLF; $manifest .= ' '; $manifest .= ' '; $manifest .= ' '.CRLF; $manifest .= ' 글의 수에는 목록에 표시할 글의 수를 지정하고 글자 수에는 글 하나당 표시할 글자 수를 입력합니다.'.CRLF; $manifest .= ' ]]>'.CRLF; $manifest .= ' '.CRLF; $manifest .= ' '.CRLF; $manifest .= '
'.CRLF; $manifest .= '
'.CRLF; $manifest .= ' '; $manifest .= ' 사용'.CRLF; $manifest .= ' 사용 안 함'.CRLF; $manifest .= ' '.CRLF; $manifest .= ' '.CRLF; $manifest .= ' '.CRLF; $manifest .= ' '.CRLF; $manifest .= '
'.CRLF; $manifest .= '
'.CRLF; $manifest .= ' '; $manifest .= ' 날짜'.CRLF; $manifest .= ' 시간'.CRLF; $manifest .= ' '.CRLF; $manifest .= ' 날짜 - 글 제목(시간)입니다.'.CRLF; $manifest .= ' ]]>'.CRLF; $manifest .= ' '.CRLF; $manifest .= ' '.CRLF; $manifest .= '
'.CRLF; $manifest .= '
'.CRLF; $manifest .= ' 미투데이]]>'.CRLF; $manifest .= '
'.CRLF; $manifest .= '
'.CRLF; $manifest .= ' ]]>'.CRLF; $manifest .= '
'.CRLF; $manifest .= '
'.CRLF; $manifest .= ' '; $manifest .= ' 사용'.CRLF; $manifest .= ' 사용 안 함'.CRLF; $manifest .= ' '.CRLF; $manifest .= ' 사용을 선택합니다. 치환자를 사용할 사람은 사이드바를 사용 안 함으로 설정하고 치환자를 스킨 파일의 원하는 위치에 삽입하면 됩니다.

이 플러그인에 대한 더 자세한 정보는 미투와 블로그를 하나로, 태터툴즈 미투데이 플러그인을 읽어보기 바랍니다.'.CRLF; $manifest .= ' ]]>'.CRLF; $manifest .= ' '.CRLF; $manifest .= '
'.CRLF; $manifest .= '
'.CRLF; $manifest .= '
'; return $manifest; } ?> #dhtmltooltip{ position: absolute; border: 1px solid #ccc; padding: 0px 5px; visibility: hidden; z-index: 100; color : #000; font-size: 11px; text-align: left; } #tooltip_ul{ list-style-type:none; margin: 0px !important; padding : 0 !important; } #tooltip_ul li{ margin: 4px !important; padding: 0px 0px 2px 18px !important; line-height: 16px !important; } #tooltip_date{ font-size: 12px; color : #000060; font-weight: bold; background : url(".$pluginURL."/date-plain.png) no-repeat 0px 50% !important; border-bottom-width: 1px !important; border-top-style: none !important; border-right-style: none !important; border-bottom-style: solid !important; border-left-style: none !important; border-bottom-color: #EEE !important; } #tooltip_post{ background : url(".$pluginURL."/doc-option-edit.png) no-repeat 0px 50% !important; border : none !important; } #tooltip_guest{ background : url(".$pluginURL."/user-plain-blue_mod.png) no-repeat 0px 50% !important; border : none !important; } #draco_counter { margin: 0px !important; padding: 0px !important;"; $target .= " font-family: Tahoma; font-size: 9px;"; if(isset($xy_color)) {$target .="color : ".$xy_color.";";} $target .=" } #draco_counter_y p{ display: block !important; margin: 0px !important; line-height: 12px !important; } #draco_counter_x p{ display: inline !important; margin: 0px !important; line-height: 12px !important; padding: 0px !important; } #draco_counter_y{ width: 30px; height: 100px; text-align: right; } #draco_counter_y_mid{ padding: 34px 0px 46px 0px; } #draco_counter_x { width : ".($graph_width)."px; height: 12px; margin: 0px !important; padding: 0px !important; } #draco_counter_x1{ float: left !important; text-align: left; } #draco_counter_x2{ float: right !important; text-align: right; }
"; $target .= ""; #그래프 왼쪽 Y축 if($disp_y=='true'){ $target .=""; } $target .= ""; #그래프 하단 X축 if($disp_x=='true'){ $target .=""; if($disp_y=='true') $target .=""; $target .=""; } $target .= "

$max_data[visits]

"; if($cut_peak == 'true') $target .= $avg; else $target .= round($max_data[visits]/2); $target .="

"; $chd = ""; $map_x = 0; $map_x_next = $map_x + intval($graph_barwidth/2); $loopcount = 0; #그래프 그리기 반복 부분 while($dcount_data=mysql_fetch_array($dcount_result)) { # 그래프 크기 계산 $dcount_data[visits]=stripslashes($dcount_data[visits]); $graph_high = round($dcount_data[visits] / $graph_max *95); if($graph_high>95) $graph_high = 95; else if($graph_high<0) $graph_high = 0; if($chd!="") $chd .= ","; $chd .= $graph_high.".0"; # 날짜 데이터 년월일로 쪼개기 $y = intval($dcount_data[date]/10000); $m = intval(($dcount_data[date]%10000)/100); $d = $dcount_data[date]%100; # 날짜 데이터 mktime $day_post1_time = mktime(0, 0, 0, $m, $d, $y); $day_post2_time = $day_post1_time + 86400; # 해당 날짜에 몇개의 글을 썼나 찾기 $day_post_query = "SELECT id FROM `".$database['prefix']."Entries` WHERE `published` >= $day_post1_time AND `published` < $day_post2_time AND `".$blogid_col."` = $owner AND `visibility` >= 2 AND `category` > 0"; $day_post_data = mysql_query($day_post_query) or die("쿼리 실패6 : " . mysql_error()); $day_post = mysql_num_rows($day_post_data); # 툴팁 창 만들기 $dcount_day = "
  • ".$y."년 ".$m."월 ".$d."일
  • 포스팅 "; if($day_post) $dcount_day .= ": ".$day_post."개"; else $dcount_day .= "없음"; $dcount_day .= "
  • 방문자 : ".$dcount_data[visits]."명
"; #이미지 맵 만들기 if($day_post){ $target .= ""; } else { $target .= ""; } $map_x = $map_x_next+1; $map_x_next = $map_x -1 + $graph_barwidth; $loopcount ++; $lastvisit = $dcount_data[visits]; } #구글 api 이미지 주소 만들기 $chart_img = "http://chart.apis.google.com/chart?chs=".$graph_width."x100&chd=t:".$chd."&cht=lc&chco=".str_replace("#","",$graph_color)."&chf=bg,s,".str_replace("#","",$graph_backcolor); if($view_grid=='true') $chart_img .="&chg=".(100/$how_day*7).",50"; if($line_blank=='true') $chart_img .= "&chls=".$line_thickness.",".($line_thickness*2).",".$line_thickness; else $chart_img .= "&chls=".$line_thickness.",".($line_thickness*2).",0"; if($graph_fillcolor) $chart_img .="&chm=B,".str_replace("#","",$graph_fillcolor).",0,0,0"; if($view_marker=='true'){ if(!$graph_fillcolor) $chart_img .="&chm="; else $chart_img .="|"; $chart_img .="c,6C57E2,0,$high_diff.0,10.0|x,E25757,0,$low_diff.0,10.0"; } if($graph_fillcolor || $view_marker=='true') $chart_overimg = $chart_img."|"; else $chart_overimg = $chart_img."&chm="; $target .= "
"; $target .= "

-$how_day days

today : $lastvisit

"; #------------------------------------------------------------------------------------------ return $target; } ?> JCF TEAM BLOG

JCF TEAM BLOG

관리자 글쓰기
블로그 »
블로그 »

정말 오래간만의 포스팅입니다. 오랜 동안의 공백기간 이후 이 사이트도 또 잠깐이나마 정상화할 수 있지 않을까 하는 기대를 해보면서 올려봅니다.

오랜 기간 숙원사업(?) 이었던 스프링과 iBATIS sqlMap을 이용해서 애플리케이션 개발/운영할 때 변경사항이 발생할 때마다 서버를 올렸다 내렸다하는 번거로움을 해소하기 위한 방법을 알려드리겠습니다.

일단 JCF 3.5 릴리즈에는 들어갈 것 같고요, 이미 여기저기서 아는 분들은 각자 만들어서 사용하고 계실만한 간단한 방법이긴 합니다만 그래도 정식 배포본에 들어가게 되었으니 언급은 하고 넘어가야겠지요?

- 착안
1. iBATIS 자체를 뜯어고치지는 않는다. 대신 스프링의 SqlMapFactoryBean을 교체 (IoC 컨테이너라 편리)
2. 실행 중 sqlMapClient를 교체하기 - 프록시 처리 및 수행 성능을 고려한 concurrency 처리
3. sqlMap 또는 sqlMapConfig의 xml이 변경되면 자동으로 리로드하도록 파일 감시.
4. Java 1.4, iBATIS 2.3.0, Spring 2.x 조합과 Java 1.5+, iBATIS 2.3.2+, Spring 2.5.5+ 조합간의 차이 처리


나머지는 Javadoc으로 대신합니다. (가만 보니 수동 리로딩에 대한 언급은 빠져있군요.)


 
RefreshableSqlMapClientFactoryBean
iBATIS sqlmap 클라이언트의 sqlMap 및 sqlMapConfig 파일의 변경을 감지, 실시간 적용하는 팩토리 빈.

개요
iBATIS + Spring 개발시 쿼리 매핑 파일이 변경되면 웹애플리케이션 서버를 재기동해야 적용이 됐었다. 이러한 불편을 없애기 위해 매핑 파일 변경을 실시간으로 감시, 적용하는 모듈을 제공한다.
감시 대상 이 모듈은 iBATIS sqlmap 클라이언트의 sqlMap 및 sqlMapConfig 파일의 변경을 감지, 실시간 적용해준다.

제약사항
감시 대상 파일들은 스타트업 당시에 결정된다. 그러므로 추가된 파일들에 대해서는 감지가 되지 않고, 삭제된 파일들에 대해서는 경고 메시지가 나온다. 예를 들어, sqlMapConfig에 sqlMap 파일이 추가되거나 하면 해당 맵이 적용되기는 하지만, 실시간 변경 감지 대상으로 추가되지는 않는다.

요구사항
iBATIS sqlmap 2.3.0, Java 1.4, Spring 2.5 이상 또는 iBATIS sqlmap 2.3.2 이상,
Java 1.5 이상, Spring 2.5.5 이상

적용 순서
1. Spring의 applicationContext 설정 파일 중 sqlMapClient를 얻기 위한 SqlMapClientFactory 빈을 신규 클래스로 교체한다.
2. 변경 감지 시간 간격 (1000분의 1초 단위)를 지정한다.

 <bean id="sqlMapClient" class="jcf.dao.ibatis.sqlmap.RefreshableSqlMapClientFactoryBean">
     <!-- <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">-->
     <property name="configLocation" value="classpath:jcf/dao/ibatis/sqlmap/sqlmap-config.xml" />
     <property name="dataSource" ref="dataSource" />
 
     <!-- Java 1.5 or higher and iBATIS 2.3.2 or higher REQUIRED -->
     <property name="mappingLocations" value="jcf/dao/\*\*\/T\*.xml" />
     <!-- <property name="mappingLocations" value="file:///D:/Type.xml" />-->
 
     <property name="checkInterval" value="1000" />
 </bean>
 
3. 라이브러리 추가
backport-util-concurrent-3.1.jar
테스트 기존의 applicationContext에 등록되어 있던 sqlMapClient에 해당하는 mappingFile들을 편집하거나, sqlMapConfig 파일 또는 그 파일에 등록된 mappingFile(sqlMap 파일)들을 편집하면 주어진 변경감지 시간 후 변경사항이 적용된다.


Author:
setq

크리에이티브 커먼즈 라이센스
Creative Commons License
Writer profile
author image
setq
2009/04/23 15:37 2009/04/23 15:37

(go to top)