176142998

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  116 Posts :: 0 Stories :: 45 Comments :: 0 Trackbacks

2011年11月7日 #

官网地址
http://www.oracle.com/technetwork/cn/middleware/ias/downloads/wls-main-091116-zhs.html


各个版本的都有,以下列举出来9.2的

Oracle WebLogic Server 9.2 MP3版本

http://download.oracle.com/otn/bea/weblogic/server923_win32.exe.zip

http://download.oracle.com/otn/bea/weblogic/server923_linux32.bin.zip

http://download.oracle.com/otn/bea/weblogic/server923_solaris32.bin.zip

 

Oracle WebLogic Server 9.2 MP4版本

 

http://download.oracle.com/otn/bea/weblogic/server924_win32.zip

 

http://download.oracle.com/otn/bea/weblogic/server924_linux32.zip

http://download.oracle.com/otn/bea/weblogic/server924_solaris32.zip

 

Oracle WebLogic Server 10.0 MP2 版本

http://download.oracle.com/otn/bea/weblogic/V16484-01.zip

posted @ 2012-04-12 09:54 飞飞 阅读(1003) | 评论 (0)编辑 收藏



linux-geum:/etc/init.d # more start_oracle.sh
#this script is used to start the oracle

su - oracle -c "/opt/oracle/product/10g/bin/dbstart"

su - oracle -c "/opt/oracle/product/10g/bin/lsnrctl start"


ln -s /etc/init.d/start_oracle.sh  /etc/rc.d/rc2.d/S16start_oracle
ln -s /etc/init.d/start_oracle.sh  /etc/rc.d/rc3.d/S16start_oracle
ln -s /etc/init.d/start_oracle.sh  /etc/rc.d/rc5.d/S16start_oracle

linux-geum:/etc/init.d # more stop_oracle.sh
#this script is used to stop the oracle

su - oracle -c "/opt/oracle/product/10g/bin/lsnrctl stop"

su - oracle -c "/opt/oracle/product/10g/bin/bin/dbshut"


ln -s /etc/init.d/stop_oracle.sh  /etc/rc.d/rc2.d/S16stop_oracle
ln -s /etc/init.d/stop_oracle.sh  /etc/rc.d/rc3.d/S16stop_oracle
ln -s /etc/init.d/stop_oracle.sh  /etc/rc.d/rc5.d/S16stop_oracle

posted @ 2012-04-06 17:35 飞飞 阅读(665) | 评论 (0)编辑 收藏

在/etc/init.d 下新建after.local或者编辑after.local文件,

文件内容
/usr/local/bin/memcached -d -m 512 -u root -l 192.168.1.106 -p 11211 -c 1024 -P /tmp/memcached.pid
posted @ 2012-04-06 17:33 飞飞 阅读(526) | 评论 (0)编辑 收藏

1、主要实现用户在进行某项操作时,多数据库的更新、插入和删除详细信息。记录操作时的请求信息。
2、在进入Controller时,生成一个事物ID,在这个Controller中进行的所有DAO操作都绑定该事物ID。并进行记录日志信息。


package com.centralsoft.filter;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Date;
import java.util.HashMap;
import java.util.regex.Pattern;

import net.sf.json.JSONObject;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.centralsoft.cache.CacheService;
import com.centralsoft.cache.annotations.Cache;
import com.centralsoft.cache.entity.MemCacheKey;
import com.centralsoft.entity.SysLogDetail;
import com.centralsoft.manager.pub.ThreadBean;
import com.centralsoft.manager.pub.ThreadId;
import com.centralsoft.pub.dao.SysLogDAO;
import com.centralsoft.webservice.pub.DateSHA;

/**
 * DAO层AOP拦截器,实现记录用户操作过的所有方法和参数,并实现DAO层缓存
 *
 * @author Administrator
 *
 */
@Aspect
@Component
public class AspectAutoDAOBean {

 @Autowired
 @Qualifier("CacheService")
 private CacheService memcache;

 @Autowired
 @Qualifier("SysLogDAO")
 private SysLogDAO SysLogDAO;

 @Around("execution(* com.centralsoft.*.dao.Zr*DAO.*(..))")
 public Object before(ProceedingJoinPoint joinPoint) throws Throwable {
  // 获取请求事务ID信息
  ThreadId threadId = new ThreadBean().getThreadId();
  // 调用方法名称
  String methodName = joinPoint.getSignature().getName();
  // 调用参数
  Object[] args = joinPoint.getArgs();
  Object object = null;

  // 数据库更新操作日志
  if (Pattern.matches("(save|insert|add|delete|remove|del|update)[\\S]*",
    methodName)) {
   if (threadId != null && threadId.getTransactionalId() != null) {
    // 获取执行请求事务ID
    String transactionalId = threadId.getTransactionalId();
    // 获取执行请求用户ID
    String userId = threadId.getUserId();
    SysLogDetail sysLogDetail = new SysLogDetail();
    sysLogDetail.setXh(transactionalId);
    sysLogDetail.setUserId(userId);
    sysLogDetail.setMethod(methodName);
    JSONObject msg = new JSONObject();
    // 处理参数
    for (Object temp : args) {
     // 获取参数类型,不同参数类型数据处理不一样
     Class<? extends Object> paramClazz = temp.getClass();
     String classType = paramClazz.getName();
     if (classType.equals("java.lang.String")) {
      msg.put("key", temp);
     } else if (classType.equals("java.util.HashMap")) {
      msg.putAll((HashMap<?, ?>) temp);
     } else if (classType.startsWith("com.")) {
      try {
       Field[] f = paramClazz.getDeclaredFields();
       for (Field field : f) {
        String fieldName = field.getName();
        field.setAccessible(true);
        msg.put(fieldName, field.get(temp));
       }
      } catch (SecurityException e) {
       e.printStackTrace();
      } catch (IllegalArgumentException e) {
       e.printStackTrace();
      }
     }
    }
    sysLogDetail.setMsg(msg.toString());
    // 记录DAO数据库操作日志
    SysLogDAO.insertSysLogDetail(sysLogDetail);
   }
   // 执行数据库操作
   object = joinPoint.proceed();

   // 数据库查询缓存
  } else if (Pattern.matches("(query|load|get|select|read)[\\S]*",
    methodName)) {
   // DAO层缓存注解
   MemCacheKey cacheKey = new MemCacheKey();
   // 获取cache注解属性
   Cache cache = null;
   // 获取请求方法
   Class<?> cls = joinPoint.getTarget().getClass();
   // 获取class中的所有方法
   Method[] methods = cls.getMethods();
   for (Method m : methods) {
    // 获取执行方法前的注解信息。
    if (m.getName().equals(methodName)) {
     cache = m.getAnnotation(Cache.class);
     break;
    }
   }

   if (cache != null) {
    // 获取memcacheKey,并进行MD5加密
    cacheKey = memcacheKey(cache, args);
    // 判断缓存服务器是否存在该可以值
    if (memcache.exist(cacheKey.getMemcacheKey())) {
     object = memcache.get(cacheKey.getMemcacheKey());
    } else {
     // 执行数据库操作
     object = joinPoint.proceed();
     // 将数据存放进缓存
     if (cacheKey.getMemcacheKey() != null) {
      memcache.put(cacheKey.getMemcacheKey(),
        object == null ? "" : object, new Date(cacheKey
          .getTime()));
     }
    }
   } else {
    // 执行数据库操作
    object = joinPoint.proceed();
   }
  } else {
   // 执行数据库操作
   object = joinPoint.proceed();
  }

  return object;

 }

 /**
  * 获取根据注解中的key获取memcache的含参数key值
  *
  * @param cache
  * @param parameterObject
  * @return
  * @author fei.zhao 2011-10-10
  */
 @SuppressWarnings("unchecked")
 private static MemCacheKey memcacheKey(Cache cache, Object[] args) {
  MemCacheKey tempKey = new MemCacheKey();
  String key = "";
  boolean flag = true;
  StringBuilder keyBuilder = new StringBuilder(32);
  // 获取注解中的key值
  String cacheKey = cache.key();
  Object[] cacheArgs = cacheKey.split("\\.");

  // 设置请求参数在args[]中的序号
  // key参数进行循环遍历
  for (Object s : cacheArgs) {
   // 判断是否是格式$,$...
   if (s.toString().startsWith("$")) {
    // 获取参数名称
    String type = s.toString().substring(1);
    // 获取参数值
    Object temp = args[0];
    // 获取参数类型,不同参数类型数据处理不一样
    Class<? extends Object> paramClazz = temp.getClass();
    String classType = paramClazz.getName();
    if (classType.equals("java.lang.String")) {
     keyBuilder.append(temp);
    } else if (classType.equals("java.util.HashMap")) {
     keyBuilder.append(((HashMap) temp).get(type));
    } else if (classType.startsWith("com.")) {
     try {
      Field f = paramClazz.getDeclaredField(type);// 实体中字段
      f.setAccessible(true);// 允许访问私有字段
      keyBuilder.append(f.get(temp));
     } catch (SecurityException e) {
      flag = false;
      e.printStackTrace();
     } catch (NoSuchFieldException e) {
      flag = false;
      e.printStackTrace();
     } catch (IllegalArgumentException e) {
      flag = false;
      e.printStackTrace();
     } catch (IllegalAccessException e) {
      flag = false;
      e.printStackTrace();
     }
    }
   } else {
    keyBuilder.append(s);
   }
   // 每个参数后面添加 “.”号分隔
   keyBuilder.append(".");
  }
  if (args.length == 3) {
   keyBuilder.append(args[1] + ".").append(args[2]);
  }
  if (flag == true) {
   key = keyBuilder.toString();
   tempKey.setMemcacheKey(DateSHA.shaEncrypt(key));
   tempKey.setTime(cache.time());
  }
  return tempKey;
 }
}

posted @ 2011-11-07 19:48 飞飞 阅读(7715) | 评论 (0)编辑 收藏