---
title: "classloader threadpool中的设计模式谈起"
author: "youngphy"
date: "2013-11-01T14:27:26Z"
tags: []
categories: ["编程语言"]
slug: "classloader-threadpool"
draft: false
lastmod: "2013-11-01T14:33:53Z"
id: 1968243
url: "https://youngphy.iteye.com/blog/1968243"
---

1. classloader为什么大多方法是protected, 除了loadClass、
classloader的findClass, threadpool的beforeExecute, threadpool 的exceptionHandler, callback都实现了客户端注入逻辑，比较
2. 通过继承来实现逻辑注入的利弊点，不利服务化，继承一般默认本地调用。
但通过继承实现，如果没有远程调用的业务要求，api倒是很易用。
3. 是撒设计模式来着？command?但command好你没有继承实现
4. loadClass, findClass, defineClass, resolveClass